Make the lint gate deterministic and enforce the documented rule set - #37
Merged
Conversation
CONTRIBUTING.md has claimed select = ["E","F","I","W"] since the lint gate was introduced, but no config file ever enforced it -- there is no pyproject.toml, ruff.toml or .ruff.toml in this repo. So `ruff check .` ran with whatever the installed version's defaults happened to be, and requirements-dev.txt carries ruff>=0.6, meaning a new ruff release can change the gate's rule set with no commit here. That is what just happened. main is green only because it has not re-run since a newer ruff landed; PR #35, which changes two markdown files and no Python, went red on SIM102 and PLW1510 findings in scripts/apply-settings.py. Adds the config, which turned out not to be a no-op: the documented selection is stricter in a direction the code had never been checked against, surfacing 8 E501 violations that ruff's defaults ignore. Those are wrapped here -- all mechanical, no behaviour change. Conversely SIM102 and PLW1510 sit outside the documented selection and no longer fire; widening the selection to include them is a deliberate policy change for a separate PR, since every repo cites this standard. Pins the rule selection rather than the ruff version, so the `>=` minimums policy stays intact while the gate stops moving on its own. Closes #36 Co-Authored-By: Claude Opus 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.
Closes #36. Unblocks #35, which is red through no fault of its own.
The problem
CONTRIBUTING.mdline 79 has documentedselect = ["E","F","I","W"]since the lint gate existed, but no config file ever enforced it — there's nopyproject.toml,ruff.toml, or.ruff.tomlin this repo. Soruff check .ran with whatever the installed version defaults to, andrequirements-dev.txtcarriesruff>=0.6.Net effect: the gate's rule set can change with no commit to this repo.
mainis green because it hasn't re-run since a newer ruff landed, not because it's clean.Not a no-op
Adding the documented config was more than paperwork — the documented selection is stricter in a direction this code had never been checked against:
SIM102×2,PLW1510, inscripts/apply-settings.pylint.select = ["E","F","I","W"]E501line-too-longSo both sets are real and disjoint. This PR wraps the 8 long lines (7 in
apply-settings.py, 1 intest_apply_settings.py) — all mechanical, no behaviour change.SIM102andPLW1510sit outside the documented selection and no longer fire. Widening the selection to include them is a deliberate policy change and belongs in its own PR, since every repo cites this standard as org-wide. Worth notingPLW1510isn't a latent bug here anyway:apply-settings.pyinspectsresult.returncodeimmediately after the call, so "fixing" it withcheck=Truewould change the control flow.Why pin the selection, not ruff
Pinning ruff exactly would contradict the
>=minimums policy inCONTRIBUTING.md§ Dependencies, and would only defer the problem to the next bump. Pinning the rule selection makes the gate deterministic while leaving that policy intact.Verification
This fixes
.githubonly. The same documented-but-unenforced selection affects otherrepos, and two of them don't lint at all — tracked in #38.
CONTRIBUTING.mdline 79 needed no edit — it already described this selection. It's now true.🤖 Generated with Claude Code