Skip to content
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 Flake8/autoflake to pre-commit #448

Open
jthorton opened this issue Dec 12, 2024 · 2 comments
Open

Add Flake8/autoflake to pre-commit #448

jthorton opened this issue Dec 12, 2024 · 2 comments

Comments

@jthorton
Copy link
Contributor

It might be good to add flake8 to the pre-commit to catch unused imports like here or formatting issues.

@IAlibay
Copy link
Member

IAlibay commented Dec 12, 2024

I've had mixed experiences with unused imports linters in libraries where you often intentionally create an unused import (i.e. to make downstream imports easier or just to keep some kind of backward compatibility).

I'd be happy to support this (especially since those two examples make sense to catch!), but would encourage caution.

@mikemhenry
Copy link
Contributor

I am pro adding it, since in the cases you mentioned @IAlibay you can add # noqa or whatever to have it ignore that line, which I think is a good thing since it makes it really explicit and clear what you are trying to do.

I agree we need to be careful to make sure that we don't remove unused imports that are in fact "used".

ruff might be another tool to look at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants