diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a44518..51773c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,7 @@ repos: rev: v0.1.1 hooks: - id: ruff + - id: ruff-format - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 @@ -39,11 +40,6 @@ repos: args: - --py36-plus - - repo: https://github.com/psf/black - rev: "23.10.1" - hooks: - - id: black - - repo: https://github.com/abravalheri/validate-pyproject rev: v0.15 hooks: diff --git a/autoflake.py b/autoflake.py index 6bd31e9..6d42f16 100755 --- a/autoflake.py +++ b/autoflake.py @@ -570,8 +570,7 @@ def filter_code( undefined_names: list[str] = [] if expand_star_imports and not ( # See explanations in #18. - re.search(r"\b__all__\b", source) - or re.search(r"\bdel\b", source) + re.search(r"\b__all__\b", source) or re.search(r"\bdel\b", source) ): marked_star_import_line_numbers = frozenset( star_import_used_line_numbers(messages), @@ -1503,8 +1502,9 @@ def _main( if not success: return 1 - if args["remove_rhs_for_unused_variables"] and not ( - args["remove_unused_variables"] + if ( + args["remove_rhs_for_unused_variables"] + and not (args["remove_unused_variables"]) ): _LOGGER.error( "Using --remove-rhs-for-unused-variables only makes sense when "