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
add autoflake to .pre-commit-config.yaml to automatically remove unused imports #1637
add autoflake to .pre-commit-config.yaml to automatically remove unused imports #1637
Conversation
f7b2d83
to
0e2950b
Compare
Can you ref/link such a failure please? To give me context mostly Thanks! |
0ee9031
to
3af7bbc
Compare
.pre-commit-config.yaml
Outdated
rev: v2.0.0 | ||
hooks: | ||
- id: autoflake | ||
args: ["--in-place", "--imports"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-i, --in-place make changes to files instead of printing diffs
Cool
--imports IMPORTS by default, only unused standard library imports are removed; specify a comma-separated list of additional modules/packages
What does the --imports
here is supposed to affect, based on the above doc?
The default should work without en empty --imports
, no?
--remove-unused-variables
remove unused variables
This might also be interesting, but I'm not 100% sure.
kombu/transport/redis.py
Outdated
@@ -1341,7 +1341,6 @@ class SentinelManagedSSLConnection( | |||
SSL Connection. | |||
""" | |||
|
|||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kombu/transport/redis.py:1346:1: E303 too many blank lines (3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll start working through this now :)
Thanks for pointing out.
0defa9e
to
ed0fe8c
Compare
for more information, see https://pre-commit.ci
pre commits are passing now |
but the lint CI is failing |
I observed a lot of ci failures related to unused typing imports being reported by flake8. This change makes it so that these will automatically get cleaned up by the pre-commit.ci bot.