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
enable ruff rule to check for unused imports #9182
base: master
Are you sure you want to change the base?
Conversation
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've been testing this one locally, and on the one hand it appears to be working, but on the other hand is scares me a lot because of the way some of these imports give the appearance of being unused.
I am putting this on testing to see how it goes. Thanks for all your work on this so far, @RayBB. I definitely want to see this merged.
@scottbarnes I agree it is a bit tricky to feel confident in this. I tried to be a bit conservative in keeping many that were kinda odd but would be good to review with someone who knows these imports better. |
It's probably OK to remove unused imports for standard library modules, but anything in the openlibrary/infogami/web.py sphere I'd be exceedingly careful of. The have been multiple attempts to do this and people always end up putting them back when they discover hidden side effect dependencies. |
Seems like it's in a good state, but we may not know what we don't know, so let's talk once more during 1:1 on Wed @scottbarnes and make sure we're happy with the approach (or whether we want to roll this out in stages) |
Closes #9181
Technical
Testing
The tests are passing, and things work fine locally. But we should be thoughtful about if any of these removed imports have side effects we need.
Screenshot
Stakeholders