Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pre-commit hook versions #184

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change was made by Black

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