Repository navigation
ci: lint in the pull request workflow - #26
Merged
Merged
Conversation
.golangci.yaml enabled errcheck, ineffassign, staticcheck and unused, and nothing ran them: the pull request workflow built, tested and measured coverage only. A lint step now runs golangci-lint with that file, pinned to v2.15.0 as the coverage tool is pinned: the job builds with the Go of go.mod (1.26, GOTOOLCHAIN=local), and v2.15.0 is the newest release whose go directive (1.26.0) that Go installs. The step's pipe fails the job on a finding (the workflow's shell is bash with pipefail). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What was wrong
.golangci.yamlenableserrcheck,ineffassign,staticcheckandunused, and nothing ran them. The pull request workflow builds, tests and measures coverage only, so a finding could merge.What changes
lintstep inpr.yaml, before the tests. It runsgolangci-lint run ./...with.golangci.yaml, and writes the report to the step summary.v2.15.0, as the coverage tool is pinned. The job builds with the Go ofgo.mod(1.26,GOTOOLCHAIN=local), so a golangci-lint whosegodirective is newer does not install.v2.15.0is the newest release, and it declaresgo 1.26.0.godirective.DEVELOPMENT_GUIDELINES.mdnames the linter in its Stack list.How it was checked
golangci-lintv2.15.0installs and reports 0 issues onmain. The test files carry no build tag, so the default run covers them.bash -eo pipefail) and its| teepipe, with a probe file holding two ineffective assignments, it exits 1 (3 issues). On the clean tree it exits 0.actionlintpasses on the workflow.🤖 Generated with Claude Code