Repository navigation
ci(examples): lint examples in CI and pre-commit - #188
Merged
Merged
Conversation
Applies ruff's safe fixes for F401 and I001 in the examples, and drops the never-read fetch_times list in streaming_guild_roster_advanced.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
examples/ was excluded from ruff check, so its findings were never seen. The remaining F841 hits assign a call's result to a named variable to show what the call returns, so ignore F841 under examples/ only and lint the rest of the directory in both the pre-commit hook and the CI job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both the pre-commit ruff hook (
exclude: ^examples/) and the CIruff checkstep skipped examples/, so 28 lint findings had built up there unseen. This clears them and lints examples/ from now on.--fixfor F401 and I001. Only unused imports are removed, and each removed name has no remaining reference in its file.fetch_timesfromexamples/Async/streaming_guild_roster_advanced.py. It was created and never read.units = await cl.get_game_data(items=DataItems.UNITS). Ruff's unsafe fix would remove that teaching value, so this PR adds"examples/**" = ["F841"]toper-file-ignoreswith its own comment. It sits apart from the "address incrementally" entries because it's intended policy, not a backlog item. F841 still applies everywhere else.excludefrom the pre-commit ruff hook and addedexamples/to the CIruff checkpaths, matching the format check.Test plan
uv run ruff check src/ tests/ examples/ parity/passesuv run ruff format --check src/ tests/ examples/ parity/passesuvx pre-commit run --all-filespassespy_compile)src/still triggers F841, so the ignore is scoped to examples/🤖 Generated with Claude Code