Skip to content

Commit 6f6561c

Browse files
chore: update pre-commit hooks (#555)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](astral-sh/ruff-pre-commit@v0.8.6...v0.9.1) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>
1 parent 78cd02f commit 6f6561c

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.8.6"
22+
rev: "v0.9.1"
2323
hooks:
2424
- id: ruff
2525
args: ["--fix", "--show-fixes"]

tests/test_compute_features.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
functions = dict(
5353
[
5454
(
55-
f'{y.__name__}({", ".join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})',
55+
f"{y.__name__}({', '.join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})",
5656
z[0],
5757
)
5858
for x, y in inspect.getmembers(
@@ -63,7 +63,7 @@
6363
]
6464
+ [
6565
(
66-
f'{y.__name__}({", ".join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})',
66+
f"{y.__name__}({', '.join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})",
6767
z[0],
6868
)
6969
for x, y in inspect.getmembers(
@@ -74,7 +74,7 @@
7474
]
7575
+ [
7676
(
77-
f'{y.__name__}({", ".join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})',
77+
f"{y.__name__}({', '.join(repr(v) if isinstance(v, str) else v.__name__ for v in w)})",
7878
z[0],
7979
)
8080
for x, y in inspect.getmembers(
@@ -158,9 +158,9 @@ def analyze_assignment(node, context):
158158
assert node.kind == "sstmt"
159159
assert len(node) == 1
160160

161-
assert (
162-
node[0].kind == "assign"
163-
), "only assignments and a final 'return' are allowed (and not tuple-assignment)"
161+
assert node[0].kind == "assign", (
162+
"only assignments and a final 'return' are allowed (and not tuple-assignment)"
163+
)
164164
assert len(node[0]) == 2
165165
assert node[0][1].kind == "store"
166166

@@ -264,9 +264,9 @@ def analyze_expression(node, context):
264264
analyze_expression(expr(node[0][0]), context)
265265
analyze_expression(expr(node[0][1]), context)
266266
assert node[0][2].kind == "COMPARE_OP"
267-
assert (
268-
node[0][2].attr in allowed_comparisons
269-
), f"add {node[0][2].attr!r} to allowed_comparisons"
267+
assert node[0][2].attr in allowed_comparisons, (
268+
f"add {node[0][2].attr!r} to allowed_comparisons"
269+
)
270270

271271
elif node.kind == "call":
272272
assert len(node) >= 2
@@ -290,15 +290,15 @@ def analyze_expression(node, context):
290290

291291

292292
def analyze_unary_operator(node, context):
293-
assert (
294-
node.kind in allowed_unary_operators
295-
), f"add {node.kind!r} to allowed_unary_operators"
293+
assert node.kind in allowed_unary_operators, (
294+
f"add {node.kind!r} to allowed_unary_operators"
295+
)
296296

297297

298298
def analyze_binary_operator(node, context):
299-
assert (
300-
node.kind in allowed_binary_operators
301-
), f"add {node.kind!r} to allowed_binary_operators"
299+
assert node.kind in allowed_binary_operators, (
300+
f"add {node.kind!r} to allowed_binary_operators"
301+
)
302302

303303

304304
def analyze_callable(node, context):
@@ -309,9 +309,9 @@ def analyze_callable(node, context):
309309
assert node[1].kind == "LOAD_METHOD"
310310

311311
if module.attr == "lib":
312-
assert (
313-
node[1].attr in allowed_lib_functions
314-
), f"add {node[1].attr!r} to allowed_lib_functions"
312+
assert node[1].attr in allowed_lib_functions, (
313+
f"add {node[1].attr!r} to allowed_lib_functions"
314+
)
315315

316316
else:
317317
module_name = ".".join(

0 commit comments

Comments
 (0)