Run the pre-commit hooks in CI (#58) #108
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED!108
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pre-commit-in-ci"
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?
Closes #58.
.pre-commit-config.yamlexisted but nothing ran it. Five of its seven hooks have no equivalent anywhere else in the pipeline —trailing-whitespace,end-of-file-fixer,check-yaml,check-merge-conflict,check-added-large-files— so they were enforced only on machines where someone had runpre-commit install. The issue offered "verify the existing CI jobs cover every hook" as an alternative; they cover two of eight, so that route was closed.Three problems surfaced on first execution
1.
check-yamlwas failing.Compose's
!resettag is valid Compose but not standard YAML, sosafe_loadcan't construct it. Excluded — Compose validates that file on every deploy anyway.2. The ruff hook pinned
v0.6.9;uv syncresolves0.15.21. That skew produces the worst kind of failure: one job failing on formatting another job considers clean, with no obvious cause. Pinned to the resolved version, and Renovate'spre-commitmanager (off by default) is now enabled so the two keep moving together — otherwise this silently re-drifts.3. The prettier hook would have reformatted 62 files / ~4,950 lines. It had never run,
prettieris not a frontend dependency, andmirrors-prettieris archived upstream. Removed. Frontend style is already gated by ESLint with--max-warnings 0. Adopting prettier deliberately — devDependency,eslint-config-prettierto stop rule conflicts, one reformat commit — is separate work, not a side effect of this issue.One trap worth flagging
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 — it merged consecutive lines ofiris-spec.md's schema list into a single paragraph:I nearly committed that. It was only visible by reading the fixer's actual diff rather than trusting that a whitespace hook does something harmless.
Net effect
After that, the accumulated debt is two lines: a stray blank line at the end of
iris-spec.md, and a missing final newline inDayCell.test.tsx. The repo was in better shape than #41's history suggested.Also
CONTRIBUTING.mdmovespre-commit installto a first-time setup step ahead of the backend/frontend sections, and corrects Prerequisites from "Python 3.12+" to 3.14+ — whatrequires-pythonhas demanded since #37, and a version that would have sent a new contributor into a broken environment.Verification
uvx pre-commit run --all-files— all seven hooks pass with no modifications.ruff,ruff format,mypyclean.ci.ymlandrenovate.jsonparse; the new job needs onlysetup-python+uv, no Node.🤖 Generated with Claude Code