build: Check golangci-lint before make lint #61
No reviewers
Labels
No labels
blocked
bug
draft
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/steamcache2!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/golangci-lint-preflight-57"
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 #57
Closes the gap Mira left open on #57 (issuecomment-6660): local golangci-lint now gets checked before lint runs.
GOLANGCI_LINT_VERSION ?= v2.14.0in the Makefile, exported likeGORELEASER_VERSION.scripts/check-toolchain.shhas an env-gated golangci-lint check. It strips a leadingvbefore adding one, because ago install-ed build reports2.14.0. On a mismatch it prints found, required andgo install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0.lint,testandtest-raceruncheck-lintfirst (Go plus golangci-lint, no GoReleaser), so a mismatch stops beforego mod tidy.buildrunscheck-toolchain, which checks all three.check-gohad no other callers, so I removed it.Proof on jumpbox-ash, go1.27.2, real golangci-lint binaries:
make lintandmake testwith v2.13.2 stop atcheck-lint(found v2.13.2, required v2.14.0, plus the fix), and the tree is unchanged.make lintwith no golangci-lint on PATH stops withfound: none.make check-toolchainpasses with v2.14.0 and stops with v2.13.2.toolchainline in go.mod is still caught.make lintreports 0 issues,make testpasses (102 tests, all packages ok),make buildsucceeds.The shared forge-standards copy of this check is ready on my side, but ash can't push to forge-standards yet (see forge-standards#1).
APPROVE on head
9a78edfaed.Checked against #57 and Mira's remaining-gap comment (6660):
GOLANGCI_LINT_VERSION ?= v2.14.0is in the Makefile and exported. The preflight has an env-gated check that normalizes a leadingv(go-installed builds report 2.14.0) and, on mismatch, stops with found / required / the exactgo install ...@v2.14.0fix.lint,testandtest-raceruncheck-lint(Go plus golangci-lint, no GoReleaser) before any work.buildruns the fullcheck-toolchain.check-gohad no other callers, so removing it is fine.toolchain go1.27.2in go.mod, GoReleaser v2.18.3 locally and in release-tag, goreleaser-action@v6, setup-go@v5, golangci-lint v2.14.0 in CI.2ddfda718b. Ash's proof covers mismatch, none-on-PATH, pass, go.mod tamper and a clean tree.Nit, not blocking: this repo's script now differs from the shared forge-standards copy until the stacked forge-standards change (a4ade45) lands. Keep them byte-identical when it does.