From 6381a6440bac02231327f7a8644721af0ef02469 Mon Sep 17 00:00:00 2001 From: k3nny Date: Sat, 11 Jul 2026 21:45:49 +0200 Subject: [PATCH] build(ci): add staticcheck to CI pipeline; fix SA4006 in gitutil test 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 --- Taskfile.yml | 3 ++- internal/gitutil/gitutil_test.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 6feb026..1dd84dd 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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: diff --git a/internal/gitutil/gitutil_test.go b/internal/gitutil/gitutil_test.go index cf7d79a..147d4ab 100644 --- a/internal/gitutil/gitutil_test.go +++ b/internal/gitutil/gitutil_test.go @@ -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 {