ci: make ruff actually lint the Python it claimed to lint - #437
Merged
Conversation
The repo-wide `ruff check .` was neither repo-wide nor reachable. Two
independent defects in helper-ci.yml, either one sufficient on its own to
hide every non-helper Python file:
1. `paths:` filtered to helper/**, three named scripts and one Swift
file, so a change to scripts/*.py never started the workflow;
2. the ruff step ran under `working-directory: helper`, so even when the
workflow DID start, `ruff check .` resolved to helper/.
Fixing only the path filter — the obvious reading — would have changed
nothing. Measured cost of the gap: 91 ruff errors that no CI run had ever
reported. PR #433 was the demonstration case, landing two F541s on main;
they have since been overwritten by #436, so the errors are gone but the
hole they came through was not.
Three parts, in the order they have to happen:
* ruff.toml at the repo root. Excludes `archive/` only — AGENTS.md lists it
under "Archived or historical" and it carried 11 of the 91. `select` is
written out explicitly as ruff 0.15.11's current defaults (verified rule-
for-rule identical, 59 rules), so raising the pin later changes rule
BEHAVIOUR without silently changing the rule SET.
* The remaining 80 errors fixed, none suppressed — no `# noqa` was needed.
38 were compound-statement splits (E701/E702) driven off ruff's own
reported offsets with an assertion that each offset really was the `;`
or `:` claimed. Behaviour is proven unchanged, not assumed: both pet
generators were run before and after and their output is byte-identical
(32KB PetGoldenVectors.json; 36 SVG frames). Every removed import was
confirmed to have no remaining reference — `math` in pet_art_gen.py is
re-imported locally as `_m`, and `json` in appstore_metadata.py survives
only as `r.json()` method calls. The one bare-except pair became
`except Exception:`, and the one discarded network probe in resubmit.py
keeps its call and drops only the unused binding.
* python-lint.yml runs ruff from the REPO ROOT on `**/*.py`, and is
registered in ci-gate.yml's GATES so it blocks. helper-ci.yml's ruff step
and pin are removed rather than duplicated: `**/*.py` is a strict superset
of helper/, and two pinned ruff versions in two workflows is exactly the
copied-constant drift this repo has been bitten by before.
The ruff==0.15.11 pin is carried over verbatim, including the 2026-07-30
incident note. Bumping it stays its own task.
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.
The gap
The repo-wide
ruff check .was neither repo-wide nor reachable. Two independent defects inhelper-ci.yml, either one sufficient on its own to hide every non-helper Python file:paths:filtered tohelper/**, three named scripts and one Swift file — a change toscripts/*.pynever started the workflow;working-directory: helper, so even when the workflow did start,ruff check .resolved tohelper/.Worth stating plainly because it changes the fix: widening the path filter alone — the obvious reading — would have changed nothing. Both had to go.
Measured cost: 91 ruff errors no CI run had ever reported. PR #433 was the demonstration case, landing two F541s on
main. Those two are already gone (overwritten by #436) — the errors were transient, the hole they came through was not.What's here
ruff.toml(new, repo root) — excludesarchive/only;AGENTS.mdlists it under Archived or historical and it carried 11 of the 91.selectis written out explicitly as ruff 0.15.11's current defaults, verified rule-for-rule identical (59 rules), so this PR changes no rule selection today but a future pin bump changes rule behaviour without silently changing the rule set.The remaining 80 errors fixed — zero suppressed. No
# noqawas needed.fprefixexcept Exception:defpython-lint.yml(new) — runsruff check .from the repo root on**/*.py, registered inci-gate.yml'sGATESso it blocks.helper-ci.yml's ruff step and pin are removed rather than duplicated:**/*.pyis a strict superset ofhelper/, and two pinned ruff versions in two workflows is the copied-constant drift this repo has been bitten by before.The
ruff==0.15.11pin carries over verbatim, 2026-07-30 incident note included. Bumping it stays its own task.Behaviour is proven unchanged, not assumed
The 38 statement splits were driven off ruff's own reported offsets, with an assertion that each offset really was the
;or:claimed — then checked against a real oracle:pet_golden_oracle.py→ 32KBPetGoldenVectors.json, byte-identical before/afterpet_art_gen.py→ 36 SVG frames, byte-identical before/afterci_check_android_strings_parity.py— executed, not just compiled (it's live inandroid-ci.yml): passespet_normalize_assets.py --selftest— passes, and a negative control confirms theif got != expect: ok = Falseline I split still flips the result and exits 1mathinpet_art_gen.pyis re-imported locally as_m;jsoninappstore_metadata.pysurvived only asr.json()method callsresubmit.py's discarded probe keeps its network call, drops only the unused bindingNot runtime-verified: the ASC operational scripts (
resubmit.py,submit_v1_*.py,appstore_metadata.py) need live App Store Connect credentials. They are byte-compiled only. Their changes are import removals, dead-binding removals andexcept:→except Exception:.The gate was verified by making it fail
Per this repo's rule about guards that never run — a green check is not evidence. On a throwaway branch, two deliberately-broken files:
Python Lint | completed | failure— and the log showsruff 0.15.11actually executing.The second probe is deliberately under a directory with spaces:
CLI Pulse Bar/scripts/holds ~24 of the repo's Python files, and a glob that silently skipped it would have recreated this exact bug. It was flagged.Exactly 2 error lines were emitted and 0 files under
archive/— which also provesruff.tomlwas read on the runner, since without itarchive/'s 11 errors would have appeared.Scratch branch deleted. On this branch:
Python Lintgreen (log confirms ruff ran),Helper CIgreen with 971 passed, 1 skipped — pytest intact after losing its neighbour step.🤖 Generated with Claude Code