Skip to content

Check unused imports via ruff#299

Open
ulgens wants to merge 4 commits into
JWock82:mainfrom
ulgens:ruff-unused-imports
Open

Check unused imports via ruff#299
ulgens wants to merge 4 commits into
JWock82:mainfrom
ulgens:ruff-unused-imports

Conversation

@ulgens

@ulgens ulgens commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

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.

@ulgens

ulgens commented Dec 17, 2025

Copy link
Copy Markdown
Contributor Author

@JBloss1517 👋🏻

ulgens added 4 commits June 7, 2026 20:43
Resolves

> imported but unused; consider removing, adding to `__all__`, or using a redundant alias

warnings
@ulgens ulgens force-pushed the ruff-unused-imports branch from 6ba8309 to 59aca05 Compare June 7, 2026 17:54
@ulgens

ulgens commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Rebased and ready for review.

@JBloss1517

Copy link
Copy Markdown
Collaborator

Thanks for following up and keeping this PR alive! I can get it reviewed this week.

@jonbiemond jonbiemond left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ulgens

ulgens commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants