From b53ccf8091aa75fe10e3ae210f7e7a08f0e28e1f Mon Sep 17 00:00:00 2001 From: Manas Srivastava Date: Thu, 4 Jun 2026 03:51:45 +0530 Subject: [PATCH] fix(lint): suppress SA5011 in test files (mirror api .golangci.yml) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit golangci-lint runs with version:latest, so a newer staticcheck (2.12.2) now flags SA5011 (possible nil pointer dereference) on the idiomatic `got := f(); if got == nil { t.Fatalf(...) }; got.X` test pattern in cmd/integration_test.go and internal/tokens/store_test.go. A nil deref in a test panics and fails the test loudly — benign test noise, not a production-safety signal. This reds lint on master (and every PR) on a fresh run, independent of any code change. Add the by-check `_test.go` SA5011 exclusion the api repo already carries (see memory project_golangci_lint_cache_masks_sa5011). Production SA5011 still fails the build — scoped to tests only, not a wholesale staticcheck disable. Unblocks the stuck dependabot actions-bump PR #22 and any future cli PR. Co-Authored-By: Claude Opus 4.8 (1M context) --- .golangci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index b836fbc..7622662 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,6 +29,19 @@ linters: linters: - errcheck - gocyclo + # SA5011 (possible nil pointer dereference) fires in test files on the + # idiomatic `got := f(); if got == nil { t.Fatalf(...) }; got.X` pattern — + # a nil deref in a test panics and fails the test loudly, so this is benign + # test noise, not a production-safety signal. golangci-lint runs with + # version:latest, so a newer staticcheck surfaces these on previously-clean + # test files (cmd/integration_test.go, internal/tokens/store_test.go). + # Suppressed by-check (SA5011) in tests only; production SA5011 still fails + # the build. Mirrors the api repo's .golangci.yml (see memory + # project_golangci_lint_cache_masks_sa5011). + - path: _test\.go + linters: + - staticcheck + text: "SA5011" issues: max-issues-per-linter: 0