Enforce pre-commit in CI so lint debt cannot re-accumulate #58
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#58
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the 2026-07-15 review follow-ups.
.pre-commit-config.yamlexists but is evidently not being run — the codebase failedruff checkin 159 places (#41). Keep #41's cleanup from eroding:pre-commit run --all-filesCI job (or verify the ruff/mypy/eslint CI jobs cover every hook in the config, and delete redundancy in one direction or the other).pre-commit-config.yamlmatch the versions CI installs (Renovate can manage pre-commit hooks: addpre-committo renovate.json managers)pre-commit installa prominent first-time setup stepDepends on: #41 (must be green first).
Audited 2026-09-01 — not started, and the second half of the first checkbox turns out to matter.
This issue offers a choice: add a
pre-commit run --all-filesjob, or verify the existing CI jobs already cover every hook. I checked the second option, and they don't..pre-commit-config.yamldeclares 8 hooks. CI covers 2 of them:ruffRuff lintruff-formatRuff format checktrailing-whitespaceend-of-file-fixercheck-yamlcheck-merge-conflictcheck-added-large-filesprettierSo the "delete the redundancy in one direction" escape hatch isn't available — six hooks have no CI equivalent at all.
check-added-large-filesandcheck-merge-conflictin particular guard against things that are annoying to undo once merged.Also confirmed:
pre-commitis not inrenovate.json, so the pinnedrevs (v4.6.0,v0.6.9,v3.1.0) drift silently. Renovate has a first-classpre-commitmanager; it needs enabling explicitly since it's off by default.Remaining work is unchanged, but now with the ambiguity resolved:
pre-commit run --all-filesjob (the alternative is ruled out — 6 of 8 hooks are uncovered)pre-committo Renovate's enabled managers so hook revs trackpre-commit installa prominent first-time setup stepOne caveat for whoever picks this up:
ruffandruff-formatwould then run twice per push, and the pinned hookrev(v0.6.9) can disagree with the ruff versionuvinstalls — a version skew that produces a job failing on formatting CI considers clean. Either pin both to the same version or drop the duplicate ruff hooks from the pre-commit job.Done in #108.
pre-commit run --all-filesCI job added. The alternative this issue offered — verifying the existing jobs already cover every hook — was checked and ruled out: they covered 2 of 8.pre-commitadded to Renovate's managers. It is off by default, which is exactly why the hook revs had gone stale.pre-commit installa first-time step ahead of the backend/frontend sections.What running them for the first time found
check-yamlwas failing ondocker-compose.registry.yml— Compose's!resettag is not standard YAML. Excluded; Compose validates that file on every deploy.v0.6.9,uv syncresolved0.15.21. Pinned together, with Renovate now keeping them in step.prettieris not a frontend dependency, andmirrors-prettieris archived upstream — it would have reformatted 62 files / ~4,950 lines. Frontend style stays gated by ESLint's--max-warnings 0. Adopting prettier properly is separate work and deserves its own issue if wanted.The one that nearly went wrong
trailing-whitespaceneeded--markdown-linebreak-ext=md. Two trailing spaces are a hard line break in Markdown, and without the flag the hook stripped them and silently reflowed the docs — merging consecutive lines ofiris-spec.md's schema list into one paragraph. The full suite had already run green and the change was staged before I read the fixer's actual diff. Worth remembering that "it only removes whitespace" is not a safe assumption for a formatter.Accumulated debt after that turned out to be two lines — a stray blank line at the end of
iris-spec.mdand a missing final newline inDayCell.test.tsx. Better than #41's history suggested.Closing.