From ce2b70d470188085f3857d26d88ba5f84dacb2e4 Mon Sep 17 00:00:00 2001 From: ScDor <18174994+ScDor@users.noreply.github.com> Date: Sat, 23 Sep 2023 20:44:06 +0300 Subject: [PATCH] MAINT: pre-commit autoupdate (#184) --- .pre-commit-config.yaml | 10 +++++----- flake8_simplify/rules/ast_for.py | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1664c1..bd1c520 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 @@ -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] diff --git a/flake8_simplify/rules/ast_for.py b/flake8_simplify/rules/ast_for.py index a0a4cdf..4dbad1e 100644 --- a/flake8_simplify/rules/ast_for.py +++ b/flake8_simplify/rules/ast_for.py @@ -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