build(ci): add staticcheck to CI pipeline; fix SA4006 in gitutil test
ci / vet, staticcheck, test, build (push) Successful in 3m5s

Add `go tool staticcheck ./...` between vet and test in the `task ci`
pipeline. Fix the SA4006 finding it surfaced: the PlainOpen error in
TestLatestTagTagsIterFails was assigned but never read (the nil check was
lost when the skip logic was simplified).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 21:45:49 +02:00
parent 4f933bf130
commit 6381a6440b
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -77,7 +77,7 @@ tasks:
- go test -run='^Fuzz' {{.PKG}}
ci:
desc: Full CI pipeline — tidy check, vet, test
desc: Full CI pipeline — tidy check, vet, staticcheck, test
cmds:
- task: tidy
- |
@@ -86,6 +86,7 @@ tasks:
exit 1
fi
- task: lint
- go tool staticcheck ./...
- task: test
clean:
+3
View File
@@ -765,6 +765,9 @@ func TestLatestTagTagsIterFails(t *testing.T) {
// Reopen so the filesystem storer holds no cached state.
repo2, err := gogit.PlainOpen(dir)
if err != nil {
t.Fatalf("PlainOpen: %v", err)
}
_, _, err = LatestTag(repo2, branch.Info{Major: 1, Minor: 2, TagPrefix: "v"})
if err == nil {