Skip to content

Commit

Permalink
[style] Fix typo detected after pre-commit autoupdate (#10202)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and Pierre-Sassoulas authored Jan 28, 2025
1 parent 05e83c4 commit 2eba0bd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
doc/data/messages/m/missing-final-newline/bad/crlf.py
)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.9.2"
rev: "v0.9.3"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -36,7 +36,7 @@ repos:
exclude: tests(/\w*)*/functional/|tests/input|doc/data/messages|examples/|setup.py|tests(/\w*)*data/
types: [python]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
exclude: doc/data/messages/
Expand Down Expand Up @@ -177,7 +177,7 @@ repos:
args: ["-r", "-lll"]
exclude: *fixtures
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
args: ["--toml=pyproject.toml"]
Expand Down
6 changes: 3 additions & 3 deletions pylint/checkers/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ def visit_try(self, node: nodes.Try) -> None:
continue

exc_ancestors = [
anc
for anc in exception.ancestors()
if isinstance(anc, nodes.ClassDef)
a
for a in exception.ancestors()
if isinstance(a, nodes.ClassDef)
]

for previous_exc in exceptions_classes:
Expand Down
6 changes: 2 additions & 4 deletions pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,7 @@ def _is_variable_violation(
# Otherwise, safe if used after assignment:
# (b := 2) and b
maybe_before_assign = defnode.value is node or any(
anc is defnode.value for anc in node.node_ancestors()
a is defnode.value for a in node.node_ancestors()
)
elif (
isinstance(defframe, nodes.ClassDef)
Expand Down Expand Up @@ -2463,9 +2463,7 @@ def _is_only_type_assignment(
# var: int
# if (var := var * var) <-- "var" still undefined
isinstance(ref_node.parent, nodes.NamedExpr)
and any(
anc is ref_node.parent.value for anc in node.node_ancestors()
)
and any(a is ref_node.parent.value for a in node.node_ancestors())
):
return False
parent = parent_scope.parent
Expand Down
8 changes: 4 additions & 4 deletions pylint/extensions/overlapping_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def visit_try(self, node: nodes.Try) -> None:
continue

exc_ancestors = [
anc for anc in exc.ancestors() if isinstance(anc, astroid.ClassDef)
a for a in exc.ancestors() if isinstance(a, astroid.ClassDef)
]

for prev_part, prev_exc in handled_in_clause:
prev_exc_ancestors = [
anc
for anc in prev_exc.ancestors()
if isinstance(anc, astroid.ClassDef)
a
for a in prev_exc.ancestors()
if isinstance(a, astroid.ClassDef)
]
if exc == prev_exc:
self.add_message(
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ext/no_self_use/no_self_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class Toto:
"""bla bal abl"""
"""Something inconsequential for the test."""

def __init__(self):
self.aaa = 2
Expand Down

0 comments on commit 2eba0bd

Please sign in to comment.