Repository navigation
chore(ci): gofmt the eight dirty files and turn the gate on (#875) - #882
Conversation
ci.yml carried a note saying gofmt was deliberately not gated because a handful of pre-existing files in compaction, reconciliation and scheduler were dirty on main, to be gated once that debt was cleared. It never was, while CLAUDE.md told contributors the check must return empty — so the instruction was false and the output was noise people learned to scroll past. Every review in a long session re-triaged the same eight files as pre-existing. The formatting change is alignment only, plus one blank comment line gofmt adds when it reflows a doc-comment code block and one trailing blank line. Verified by stripping all whitespace from both sides of the diff and comparing what remains, and by running build, vet and the race suite for all three packages and then for ./internal/... entire. The gate itself is verified in both directions: it passes on the formatted tree, and a deliberately misformatted probe file makes it fail with the file named. It runs before the build, so a formatting-only failure reports in seconds rather than after the race suite. Claude-Session: https://claude.ai/code/session_01So2gKWp5TzF9gu3QKNqdeV
Review pointed out that pkg/ and scripts/ are Go too and were unchecked. They are clean today, so covering them costs nothing now and closes the hole permanently — and it matches `make fmt`, which formats the whole tree. The suggested fix in the failure message widens with it. A narrower suggestion than the check is the same trap in miniature: a contributor runs what the message says, sees it pass, and CI still fails. Verified both ways, including that a misformatted file in pkg/models — outside the old scope — now fails the gate. Claude-Session: https://claude.ai/code/session_01So2gKWp5TzF9gu3QKNqdeV
|
Review came back clean, and it verified the formatting more rigorously than I had. It re-ran Took its one substantive suggestion: the gate now covers the whole repository instead of just The suggested fix in the failure message widened with it. A fix command narrower than the check would be this same trap in miniature: a contributor runs what the message says, sees it pass, and CI still fails. Verified that a misformatted file in Two things from the review worth recording for whoever merges this. Open branches need no rebase: the Format step runs on the PR merge ref, so they inherit this fix and go green on their own. And none of the other remote branches touches any of the eight files, so there is no textual conflict to manage. |
Closes #875.
ci.ymlcarried this note:The debt was never cleared, while the project instructions told contributors
gofmt -l ./internal ./cmd"must return empty". So the instruction was false, and the output was noise people learned to scroll past. Every review in a long session re-triaged the same eight files as pre-existing.The formatting change is semantics-free
Alignment, plus one blank comment line that gofmt adds when it reflows a doc-comment code block in
watcher.go, plus one trailing blank line. Verified by stripping all whitespace from both sides of the diff and comparing what remained, which leaves only the added comment marker.The gate
Added to the
testjob before the build, so a formatting-only failure reports in seconds rather than after the race suite, and it names the offending files rather than just exiting non-zero.Test plan
go build ./...,go veton all three packages, andgo test -race ./internal/...entire, all green.Timing
The issue asked for this to land when nothing was in flight in
internal/compaction,internal/reconciliationorinternal/scheduler, since a whitespace-only change across a package conflicts with any open branch that touches it. Nothing of mine is open in those packages now.https://claude.ai/code/session_01So2gKWp5TzF9gu3QKNqdeV