Skip to content

Commit 2eba0bd

Browse files
[style] Fix typo detected after pre-commit autoupdate (#10202)
updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.2 → v0.9.3](astral-sh/ruff-pre-commit@v0.9.2...v0.9.3) - [github.com/PyCQA/isort: 5.13.2 → 6.0.0](PyCQA/isort@5.13.2...6.0.0) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.0](codespell-project/codespell@v2.3.0...v2.4.0) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
1 parent 05e83c4 commit 2eba0bd

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
doc/data/messages/m/missing-final-newline/bad/crlf.py
2121
)$
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: "v0.9.2"
23+
rev: "v0.9.3"
2424
hooks:
2525
- id: ruff
2626
args: ["--fix"]
@@ -36,7 +36,7 @@ repos:
3636
exclude: tests(/\w*)*/functional/|tests/input|doc/data/messages|examples/|setup.py|tests(/\w*)*data/
3737
types: [python]
3838
- repo: https://github.com/PyCQA/isort
39-
rev: 5.13.2
39+
rev: 6.0.0
4040
hooks:
4141
- id: isort
4242
exclude: doc/data/messages/
@@ -177,7 +177,7 @@ repos:
177177
args: ["-r", "-lll"]
178178
exclude: *fixtures
179179
- repo: https://github.com/codespell-project/codespell
180-
rev: v2.3.0
180+
rev: v2.4.0
181181
hooks:
182182
- id: codespell
183183
args: ["--toml=pyproject.toml"]

pylint/checkers/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ def visit_try(self, node: nodes.Try) -> None:
612612
continue
613613

614614
exc_ancestors = [
615-
anc
616-
for anc in exception.ancestors()
617-
if isinstance(anc, nodes.ClassDef)
615+
a
616+
for a in exception.ancestors()
617+
if isinstance(a, nodes.ClassDef)
618618
]
619619

620620
for previous_exc in exceptions_classes:

pylint/checkers/variables.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,7 @@ def _is_variable_violation(
23392339
# Otherwise, safe if used after assignment:
23402340
# (b := 2) and b
23412341
maybe_before_assign = defnode.value is node or any(
2342-
anc is defnode.value for anc in node.node_ancestors()
2342+
a is defnode.value for a in node.node_ancestors()
23432343
)
23442344
elif (
23452345
isinstance(defframe, nodes.ClassDef)
@@ -2463,9 +2463,7 @@ def _is_only_type_assignment(
24632463
# var: int
24642464
# if (var := var * var) <-- "var" still undefined
24652465
isinstance(ref_node.parent, nodes.NamedExpr)
2466-
and any(
2467-
anc is ref_node.parent.value for anc in node.node_ancestors()
2468-
)
2466+
and any(a is ref_node.parent.value for a in node.node_ancestors())
24692467
):
24702468
return False
24712469
parent = parent_scope.parent

pylint/extensions/overlapping_exceptions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ def visit_try(self, node: nodes.Try) -> None:
6060
continue
6161

6262
exc_ancestors = [
63-
anc for anc in exc.ancestors() if isinstance(anc, astroid.ClassDef)
63+
a for a in exc.ancestors() if isinstance(a, astroid.ClassDef)
6464
]
6565

6666
for prev_part, prev_exc in handled_in_clause:
6767
prev_exc_ancestors = [
68-
anc
69-
for anc in prev_exc.ancestors()
70-
if isinstance(anc, astroid.ClassDef)
68+
a
69+
for a in prev_exc.ancestors()
70+
if isinstance(a, astroid.ClassDef)
7171
]
7272
if exc == prev_exc:
7373
self.add_message(

tests/functional/ext/no_self_use/no_self_use.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Toto:
8-
"""bla bal abl"""
8+
"""Something inconsequential for the test."""
99

1010
def __init__(self):
1111
self.aaa = 2

0 commit comments

Comments
 (0)