chore: add make check and drive the CI lint gate from it - #15
Merged
Conversation
PR #12 shipped a formatting error that CI would have caught, because nothing a contributor could run locally reproduced the CI gate: - `make fmt` ran plain `go fmt`, which does not apply `-s`. The target named "fmt" therefore did not satisfy the format gate named "Check formatting". - The gate itself lived only in the workflow YAML, so there was no way to run it short of pushing and waiting. Adds `make check`, which runs every gate the lint job enforces: check-fmt, vet, mod-verify and test-race. The workflow now calls those same targets instead of duplicating the commands, so the two cannot drift. Also: - `make fmt` now runs `gofmt -s -w .`, so it fixes exactly what check-fmt checks. - `.PHONY` was missing most targets; all of them are listed now. - CONTRIBUTING.md's pre-PR checklist collapses to `make check`, and the note explaining the old `make fmt` trap is gone because the trap is gone. - CONTRIBUTING.md gains a note that CI runners are UTC, so timestamp tests must pin their zone. #12 shipped a test that asserted against `t.Local()` and so passed in CI while failing from UTC+11 east. Verified: `make check` passes; `make check-fmt` fails as expected on deliberately unformatted input and `make fmt` clears it.
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.
Goal
Make the CI lint gate reproducible locally, so a contributor can tell whether their branch will pass before they push.
PR #12 shipped a
gofmt -sviolation through a full review cycle. The reason wasn't carelessness — nothing they could run locally reproduced the gate:make fmtran plaingo fmt, which does not apply-s. The target named "fmt" did not satisfy the gate named "Check formatting".test.yml, so the only way to run it was to push and wait.action_required.CONTRIBUTING.mddocumented themake fmttrap in prose. That wasn't enough — the fix is to remove the trap, not describe it.Changes
make checkruns every gate the lint job enforces:The workflow now calls those targets instead of duplicating the commands inline, so the Makefile and CI cannot drift:
make fmtnow runsgofmt -s -w .— it fixes exactly whatcheck-fmtchecks..PHONYwas missingfmt,lint,tidyand the per-platform build targets. All listed now.Docs: the pre-PR checklist in
CONTRIBUTING.mdcollapses to a singlemake check, and the paragraph explaining themake fmttrap is deleted because the trap is gone. Added a note that CI runners are UTC, so timestamp tests must pin their zone — #12 also shipped a test asserting againstt.Local(), which passed in CI and failed from UTC+11 east.The test job is unchanged: it needs the coverage flags and the OS matrix, so it stays inline.
Verification
make checkpasses.make check-fmtfails as expected on deliberately unformatted input, naming the file and pointing atmake fmt;make fmtthen clears it. This is the gate that silently passed before.TZ=Pacific/Auckland go test ./...passes.Not in this PR
Enabling Actions for outside contributors is a repo setting, not code — Settings → Actions → General → "Fork pull request workflows from outside collaborators". Until that changes, first-time contributors still get zero CI feedback, which was the larger half of what went wrong on #12.
Tasks
make checkrunning the CI gatesmake fmtto apply-sCONTRIBUTING.mdandCLAUDE.mdRelates to #12
⚡ Built on gilfoyle with Claude Code