Skip to content

Commit

Permalink
MAINT: pre-commit autoupdate (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScDor committed Sep 23, 2023
1 parent 8c43a67 commit ce2b70d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-byte-order-marker
Expand All @@ -17,7 +17,7 @@ repos:
# hooks:
# - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.3.0
hooks:
- id: mypy
- repo: https://github.com/asottile/seed-isort-config
Expand All @@ -29,16 +29,16 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.1.0]
10 changes: 6 additions & 4 deletions flake8_simplify/rules/ast_for.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ def get_sim104(node: ast.For) -> List[Tuple[int, int, str]]:
return errors

parent = getattr(node, "parent", None)
while (parent
and hasattr(parent, "parent")
and parent.parent is not parent
and not isinstance(parent, ast.AsyncFunctionDef)):
while (
parent
and hasattr(parent, "parent")
and parent.parent is not parent
and not isinstance(parent, ast.AsyncFunctionDef)
):
parent = getattr(parent, "parent", None)

if isinstance(parent, ast.AsyncFunctionDef): # type: ignore
Expand Down

0 comments on commit ce2b70d

Please sign in to comment.