You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rob-levy-minimum does adding --in-place fix it? I wonder if there's a way for us to detect that we're being invoked by pre-commit and change the default value for for that flag.
If you specify
--remove-all-unused-imports
in theargs
section of.pre-commit.yaml
then the hook always passes, even when you have unused imports.Case study
.pre-commit.yaml
foo.py
Try commiting
foo.py
and the hook will pass!If I remove the arg then the hook works as expected.
It works as expected when running from the command line:
$ autoflake --remove-all-unused-imports foo.py --- original/foo.py +++ fixed/foo.py @@ -1,3 +1,2 @@ -import random print("Does nothing")
The text was updated successfully, but these errors were encountered: