-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Run pycln
as a pre-commit hook in CI
#8304
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
Conversation
This comment has been minimized.
This comment has been minimized.
Here's |
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.
LGTM, but I would like to hear feedback of other maintainers.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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'm fine with this. Not familiar with pycln, but it looks like it uses libcst, which is promising (unlike isort, which was plagued with bugs for a long time).
Have you tried running pycln on all of our existing stubs? Does it delete anything? If it does, a file like that would be quite annoying to contribute to. |
Yes, I ran it on the whole of typeshed before filing this PR. It made changes to It also identified unused imports in So if this PR is merged, the entirety of typeshed should be |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
pycln
is a pre-commit hook to auto-remove unused import statements. The tool is used by several high-profile open-source projects such as Pyodide, Poetry and Rich. It is fully compatible with.pyi
files as well as.py
files.