Check unused imports via ruff#299
Conversation
|
@JBloss1517 👋🏻 |
Resolves > imported but unused; consider removing, adding to `__all__`, or using a redundant alias warnings
6ba8309 to
59aca05
Compare
|
Rebased and ready for review. |
|
Thanks for following up and keeping this PR alive! I can get it reviewed this week. |
jonbiemond
left a comment
There was a problem hiding this comment.
Awesome to see! Amazing how many unused imports stick around.
I just want to note that by running ruff via prek we're missing out on inline annotations in GitHub. See the workflow examples provided by Astral: https://docs.astral.sh/ruff/integrations/#github-actions
Of course, in the case maintainers or contributors choose to adopt prek locally, the benefit of using prek in CI is that the lint config is specified in only one location.
|
I agree the inline annotations looks nice, but they are limited to certain tools and normally the expectation is that the developers will fix these issues in their local and CI check is there just to ensure they are running it locally. |
Adds a very basic ruff config to check F401 - unused import rule.
The ruff setup can be extended later.
I added a simple workflow to run pre-commit hooks in CI.