Skip to content

One ruff rule set, defined in pyproject and used by CI - #7

Merged
stefan-jansen merged 1 commit into
mainfrom
chore/ruff-rule-set
Sep 7, 2026
Merged

One ruff rule set, defined in pyproject and used by CI#7
stefan-jansen merged 1 commit into
mainfrom
chore/ruff-rule-set

Conversation

@stefan-jansen

Copy link
Copy Markdown
Contributor

CI ran ruff check --isolated --select E4,E7,E9,F, so the config file could never be the definition. A bare uv run ruff check src tests reported 41 findings under ruff 0.16.6's defaults while CI passed clean - two commands answering different questions.

[tool.ruff.lint] select now names E4/E7/E9/F plus I, UP and B, and CI runs the plain command against it.

The wider default set is deliberately not adopted: S102 and BLE001 fire on choices this package makes on purpose - exec rebuilds a student's saved component, and a broad except is what keeps one wrong component from ending their session.

Of the 18 findings the new set produced, 14 were auto-fixed (typing.Callable to collections.abc, unquoted self-references, import order) and 4 were decided by hand: three zip calls take strict=True, and one unused loop variable is renamed. The zip(names, stages) in checks.py is the one that earns the rule - a stage added without a matching name would have been skipped silently.

CI ran `--isolated --select E4,E7,E9,F`, so the config file could never be the
definition: a bare `ruff check` reported 41 findings under ruff 0.16.6's
defaults while CI passed clean. The config now selects E4/E7/E9/F plus I, UP and
B, and CI runs the plain command.

The wider default set is not adopted. S102 and BLE001 fire on deliberate
choices here - `exec` rebuilds a student's saved component, and a broad
`except` is what keeps one wrong component from ending their session.

Twenty findings were mechanical: `typing.Callable` to `collections.abc`,
unquoted self-references, import order. Four needed a decision. Three zips get
`strict=True`; the one over `names` and `stages` in `checks.py` is the reason
the rule earns its place, since a stage added without a name would otherwise
have been skipped in silence.
Copilot AI lite review requested due to automatic review settings September 7, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen
stefan-jansen deleted the chore/ruff-rule-set branch September 7, 2026 18:53
@stefan-jansen
stefan-jansen restored the chore/ruff-rule-set branch September 7, 2026 18:54
@stefan-jansen stefan-jansen reopened this Sep 7, 2026
@stefan-jansen
stefan-jansen merged commit feadbba into main Sep 7, 2026
34 checks passed
@stefan-jansen
stefan-jansen deleted the chore/ruff-rule-set branch September 7, 2026 18:57
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.

2 participants