Skip to content

ci: run the lint config the repo actually declares - #268

Merged
gonzaloserrano merged 1 commit into
mainfrom
ci-enforce-lint-config
Aug 6, 2026
Merged

ci: run the lint config the repo actually declares#268
gonzaloserrano merged 1 commit into
mainfrom
ci-enforce-lint-config

Conversation

@gonzaloserrano

Copy link
Copy Markdown
Contributor

CI's lint gate has not been enforcing .golangci.yml. The config is schema v2, but the workflow pinned golangci-lint v1.57.2, which does not recognise the v2-only linters.settings and formatters sections and drops them without erroring. The revive rule list and the goimports check have been dead in CI, so the green checks came from a weaker default set. Probing both binaries against the same config: v2.6.0 flags get-return and goimports violations, v1.57.2 flags neither.

Lint now runs make lint, so CI and local share the single version pinned in the Makefile and cannot drift apart again. The tradeoff is compiling golangci-lint on a cold cache instead of downloading a prebuilt binary.

Also renames the build job to test and drops the duplicate make build, which ran clean+build twice while make test does not need the binary. Both jobs now pin go-version: stable, replacing the spread of go.mod 1.20, the lint job's 1.21 and the build job's unpinned runner default. Adds least-privilege permissions and cancellation of superseded pull request runs.

.golangci.yml is schema v2, but the workflow pinned golangci-lint
v1.57.2, which silently ignores the v2-only `linters.settings` and
`formatters` sections. The revive rule list and the goimports check
never ran in CI. Lint now runs `make lint`, so CI and local share the
single version pinned in the Makefile.

Rename the build job to test and drop the duplicate `make build`. The
job ran clean+build twice, and `make test` does not need the binary.

Pin both jobs to `go-version: stable`, replacing the spread of go.mod
1.20, the lint job's 1.21 and the build job's unpinned runner default.

Add least-privilege permissions, cancel superseded pull request runs,
and drop `fetch-depth: 0` since the version stamp works at depth 1.
@gonzaloserrano
gonzaloserrano merged commit 60daa90 into main Aug 6, 2026
2 checks passed
@gonzaloserrano
gonzaloserrano deleted the ci-enforce-lint-config branch August 6, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant