Skip to content

Commit 392055b

Browse files
authored
Upgrade all dependencies (#358)
1 parent 545824d commit 392055b

5 files changed

Lines changed: 26 additions & 59 deletions

File tree

wpiformat/pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ readme = "README.md"
66
license = "BSD-3-Clause"
77
requires-python = ">=3.11"
88
dependencies = [
9-
"autoflake==2.3.1",
10-
"black==25.9.0",
11-
"clang-format==21.1.2",
12-
"clang-tidy==21.1.1",
9+
"autoflake==2.3.3",
10+
"black==26.3.1",
11+
"clang-format==22.1.1",
12+
"clang-tidy==22.1.0",
1313
"cpplint==2.0.2",
14-
"gersemi==0.22.3",
15-
"isort==7.0.0"
14+
"gersemi==0.26.0",
15+
"isort==8.0.1"
1616
]
1717
classifiers = [
1818
"Development Status :: 5 - Production/Stable",

wpiformat/test/test_config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
def test_config():
1010
with OpenTemporaryDirectory():
1111
subprocess.run(["git", "init", "-q"])
12-
Path(".wpiformat").write_text(
13-
r"""generatedFileExclude {
12+
Path(".wpiformat").write_text(r"""generatedFileExclude {
1413
/cpplint\.py$
1514
}
1615
1716
modifiableFileExclude {
1817
\.png$
1918
}
20-
"""
21-
)
19+
""")
2220

2321
config_file = Config(Path.cwd(), Path(".wpiformat"))
2422
assert config_file.is_modifiable_file(

wpiformat/test/test_includeguard.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
def test_includeguard():
1111
with OpenTemporaryDirectory():
1212
subprocess.run(["git", "init", "-q"])
13-
Path(".wpiformat").write_text(
14-
r"""includeGuardRoots {
13+
Path(".wpiformat").write_text(r"""includeGuardRoots {
1514
test/
1615
}
17-
"""
18-
)
16+
""")
1917

2018
test_hpp = Path("./Test.hpp").resolve()
2119
test_test_hpp = Path("./test/Test.hpp").resolve()

wpiformat/test/test_licenseupdate.py

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212
def test_licenseupdate():
1313
with OpenTemporaryDirectory():
1414
subprocess.run(["git", "init", "-q"])
15-
Path(".wpiformat").write_text(
16-
r"""licenseUpdateExclude {
15+
Path(".wpiformat").write_text(r"""licenseUpdateExclude {
1716
Excluded\.hpp$
1817
}
19-
"""
20-
)
21-
Path(".wpiformat-license").write_text(
22-
"""/*{padding}Company Name{padding}*/
18+
""")
19+
Path(".wpiformat-license").write_text("""/*{padding}Company Name{padding}*/
2320
/* Copyright (c) {year} Company Name. All Rights Reserved.{padding}*/
24-
"""
25-
)
21+
""")
2622
subprocess.run(["git", "add", ".wpiformat"])
2723
subprocess.run(["git", "add", ".wpiformat-license"])
2824
subprocess.run(["git", "commit", "-q", "-m", '"Initial commit"'])
@@ -75,8 +71,7 @@ def test_licenseupdate():
7571
/* Company Name */
7672
/* Copyright (c) {year} Company Name. All Rights Reserved. */
7773
78-
"""
79-
+ file_appendix,
74+
""" + file_appendix,
8075
f"""/* Company Name */
8176
/* Copyright (c) {year} Company Name. All Rights Reserved. */
8277
@@ -216,8 +211,7 @@ def test_licenseupdate():
216211
"""/* Company Name */
217212
/* Copyright (c) 1992-2015 Company Name. All Rights Reserved. */
218213
219-
"""
220-
+ file_appendix,
214+
""" + file_appendix,
221215
f"""/* Company Name */
222216
/* Copyright (c) 1992-{year} Company Name. All Rights Reserved. */
223217
@@ -293,13 +287,10 @@ def test_licenseupdate():
293287
output, success = LicenseUpdate().run_pipeline(
294288
config_file, last_year_cpp, lines + "change\n"
295289
)
296-
assert (
297-
output
298-
== f"""// Copyright (c) 2017-{year}
290+
assert output == f"""// Copyright (c) 2017-{year}
299291
300292
change
301293
"""
302-
)
303294

304295
# Erase changes made to last-year.cpp in previous test
305296
Path("last-year.cpp").write_text(lines)
@@ -309,46 +300,35 @@ def test_licenseupdate():
309300
output, success = LicenseUpdate().run_pipeline(
310301
config_file, this_year_cpp, lines
311302
)
312-
assert (
313-
output
314-
== f"""// Copyright (c) 2017-{year}
303+
assert output == f"""// Copyright (c) 2017-{year}
315304
316305
"""
317-
)
318306

319307
# Run wpiformat on next-year.cpp
320308
lines = Path("next-year.cpp").read_text()
321309
output, success = LicenseUpdate().run_pipeline(
322310
config_file, next_year_cpp, lines
323311
)
324-
assert (
325-
output
326-
== f"""// Copyright (c) 2017-{int(year) + 1}
312+
assert output == f"""// Copyright (c) 2017-{int(year) + 1}
327313
328314
"""
329-
)
330315

331316
# Run wpiformat on no-year.cpp
332317
# Should have current calendar year
333318
lines = Path("no-year.cpp").read_text()
334319
output, success = LicenseUpdate().run_pipeline(config_file, no_year_cpp, lines)
335-
assert (
336-
output
337-
== f"""// Copyright (c) {year}
320+
assert output == f"""// Copyright (c) {year}
338321
339322
"""
340-
)
341323

342324
# Create git repo to test filename expansion
343325
with OpenTemporaryDirectory():
344326
subprocess.run(["git", "init", "-q"])
345327

346328
# Add base files
347-
Path(".wpiformat-license").write_text(
348-
"""// Copyright (c) {year}
329+
Path(".wpiformat-license").write_text("""// Copyright (c) {year}
349330
// https://github.com/wpilibsuite/styleguide/blob/main/{filename}
350-
"""
351-
)
331+
""")
352332
subprocess.run(["git", "add", ".wpiformat"])
353333
subprocess.run(["git", "add", ".wpiformat-license"])
354334
subprocess.run(["git", "commit", "-q", "-m", '"Initial commit"'])
@@ -360,10 +340,7 @@ def test_licenseupdate():
360340

361341
# Empty file
362342
output, success = LicenseUpdate().run_pipeline(config_file, file, "")
363-
assert (
364-
output
365-
== f"""// Copyright (c) {year}
343+
assert output == f"""// Copyright (c) {year}
366344
// https://github.com/wpilibsuite/styleguide/blob/main/dir/empty.cpp
367345
368346
"""
369-
)

wpiformat/wpiformat/jni.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,11 @@ def run_pipeline(
114114
comment += f"""/*
115115
* Class: {match.group("class")}
116116
* Method: {match.group("method")}
117-
* Signature: (""".replace(
118-
"\n", linesep
119-
)
117+
* Signature: (""".replace("\n", linesep)
120118

121119
signature += f"""JNIEXPORT {match_sig.group("ret")} JNICALL
122120
{match_sig.group("func")}
123-
{jni_args}""".replace(
124-
"\n", linesep
125-
)
121+
{jni_args}""".replace("\n", linesep)
126122

127123
# Add other args
128124
line_length = len(jni_args)
@@ -144,9 +140,7 @@ def run_pipeline(
144140
comment += self.map_jni_type(match_arg.group("arg_type"))
145141
comment += f"""){self.map_jni_type(match_sig.group("ret"))}
146142
*/
147-
""".replace(
148-
"\n", linesep
149-
)
143+
""".replace("\n", linesep)
150144

151145
# Output correct trailing character for declaration vs definition
152146
if match_arg.group("trailing") == "{":

0 commit comments

Comments
 (0)