ci: local↔CI test parity — make verify + pinned golangci-lint + .golangci.yml#49
ci: local↔CI test parity — make verify + pinned golangci-lint + .golangci.yml#49bdchatham wants to merge 2 commits into
Conversation
Closes the "passes locally, fails CI" gap: the dev loop ran go build / test / vet but not golangci-lint, so staticcheck violations (SA9005, SA4015, ST1023) slipped past local checks and failed CI. - `make verify`: runs the exact CI gate in order — lint, test, check-bindings. One command for local CI parity; run before pushing. - Pin golangci-lint to v2.12.2 (what the workflow's `latest` currently resolves to) in three synced places: GOLANGCI_VERSION (Makefile), the golangci-lint-action `version:`, and a new `.golangci.yml`. - `install-lint` target (go install at the pinned tag), wired into install-tools. `make lint` warns if the PATH binary differs. - `.golangci.yml` pins v2.12.2's default linter set explicitly (errcheck, govet, ineffassign, staticcheck, unused) for determinism, not stricter-than-today — repo is clean under it. - Document the pre-push flow in `make help` and README. `make verify` passes end-to-end and `golangci-lint run` is clean on this branch under v2.12.2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Note staticcheck subsumes ST* stylecheck diagnostics in v2 (ST1023). - install-tools also sets up Node via nvm; point to install-lint for linter-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview
golangci-lint v2.12.2 is pinned in three places: the README adds a Before you push section; test help text notes Reviewed by Cursor Bugbot for commit 2015776. Bugbot is set up for automated code reviews on this repo. Configure here. |
Closes the gap that let staticcheck violations slip to CI on #46/#48: our local loop ran
build+test+vet(nogolangci-lint), and CI's linter was unpinned (latest).What (parity + determinism, not a CI rewrite)
make verify=lint+test+check-bindings— runs exactly what CI gates, in one command. Run it before pushing.build-and-test.ymlaction (latest→v2.12.2), a MakefileGOLANGCI_VERSION+make install-lint, and a new.golangci.ymlthat freezes the enabled linter set (v2.12.2 defaults: errcheck, govet, ineffassign, staticcheck, unused).make lintwarns if your PATH binary drifts.Why
go vetdoesn't run staticcheck; CI's golangci-lint does — andversion: latestdrifts (local 2.12.1 vs CI 2.12.2). Pinning + a singleverifytarget makes local results match CI deterministically.Review
Idiom: clean (mirrors the existing
SOLC_VERSION/GETH_VERSIONpinning convention). Security: net supply-chain improvement (pinning narrows drift;go install @v2.12.2is checksum-DB-backed) — no token/permission/trigger changes.Tracked: PLT-474. (Deferred, noted in review: SHA-pinning the
@v7action major — pre-existing repo convention, repo-wide pass.)🤖 Generated with Claude Code