From 05e6eeeb3224aa7b60b62e4345a6543099dc9f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sat, 8 Nov 2025 14:52:53 +0100 Subject: [PATCH 1/3] lint bump --- .github/workflows/lint.yml | 2 +- .golangci.yml | 7 +++++-- Makefile | 2 +- main.go | 2 ++ pkg/testcoverage/check_test.go | 2 +- pkg/testcoverage/config.go | 2 ++ pkg/testcoverage/coverage/module.go | 1 + 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 086a60c..3d54645 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: v2.0.1 # LINT_VERSION: update version in other places + version: v2.6.1 # LINT_VERSION: update version in other places - id: govulncheck uses: golang/govulncheck-action@v1 diff --git a/.golangci.yml b/.golangci.yml index ebb6ecc..ab2b97d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,7 @@ linters: - dupl - dupword - durationcheck + - embeddedstructfieldcheck - err113 - errchkjson - errname @@ -24,6 +25,7 @@ linters: - forbidigo - forcetypeassert - funlen + - funcorder - gocheckcompilerdirectives - gochecknoglobals - gochecknoinits @@ -44,6 +46,7 @@ linters: - inamedparam - interfacebloat - intrange + - iotamixing - lll - loggercheck - maintidx @@ -86,7 +89,7 @@ linters: - wastedassign - whitespace - wrapcheck - - wsl + - wsl_v5 - zerologlint settings: dupl: @@ -141,7 +144,7 @@ linters: enable-all: true unparam: check-exported: true - wsl: + wsl_v5: force-err-cuddling: true exclusions: generated: lax diff --git a/Makefile b/Makefile index 9c49640..94b5312 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO ?= go GOBIN ?= $$($(GO) env GOPATH)/bin GOLANGCI_LINT ?= $(GOBIN)/golangci-lint -GOLANGCI_LINT_VERSION ?= v2.0.1 # LINT_VERSION: update version in other places +GOLANGCI_LINT_VERSION ?= v2.6.1 # LINT_VERSION: update version in other places # Code tidy .PHONY: tidy diff --git a/main.go b/main.go index 6279905..f5952cd 100644 --- a/main.go +++ b/main.go @@ -27,12 +27,14 @@ func main() { if err != nil { fmt.Println("Running coverage check failed.") fmt.Printf("Error: %v\n", err) + if cfg.GithubActionOutput { fmt.Printf("Please set `debug: true` input to see detailed output.") } else { fmt.Println("Please use `--debug=true` flag to see detailed output.") } } + if !pass || err != nil { os.Exit(1) } diff --git a/pkg/testcoverage/check_test.go b/pkg/testcoverage/check_test.go index e5ba818..b215201 100644 --- a/pkg/testcoverage/check_test.go +++ b/pkg/testcoverage/check_test.go @@ -463,7 +463,7 @@ func TestCheckNoParallel(t *testing.T) { t.Run("logger has output", func(t *testing.T) { logger.Init() - defer logger.Destruct() + defer logger.Destruct() //nolint:wsl_v5 // relax buf := &bytes.Buffer{} cfg := Config{ diff --git a/pkg/testcoverage/config.go b/pkg/testcoverage/config.go index 1090931..e1d4d02 100644 --- a/pkg/testcoverage/config.go +++ b/pkg/testcoverage/config.go @@ -71,9 +71,11 @@ func (c Config) Redacted() Config { if r.Badge.CDN.Key != "" { r.Badge.CDN.Key = r.Badge.CDN.Key[0:min(len(r.Badge.CDN.Key), 5)] + HiddenValue } + if r.Badge.CDN.Secret != "" { r.Badge.CDN.Secret = HiddenValue } + if r.Badge.Git.Token != "" { r.Badge.Git.Token = HiddenValue } diff --git a/pkg/testcoverage/coverage/module.go b/pkg/testcoverage/coverage/module.go index eeb7666..3c0e9d4 100644 --- a/pkg/testcoverage/coverage/module.go +++ b/pkg/testcoverage/coverage/module.go @@ -14,6 +14,7 @@ func findModuleDirective(rootDir string) string { if goModFile == "" { logger.L.Warn().Str("dir", rootDir). Msg("go.mod file not found in root directory (consider setting up source dir)") + return "" } From 3910b9a3ddfcfc982f7ea9e8fbbd6c83e3f301c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sat, 8 Nov 2025 14:56:29 +0100 Subject: [PATCH 2/3] version --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3d54645..27388b5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: - name: go mod tidy check uses: katexochen/go-tidy-check@v2 - name: golangci-lint - uses: golangci/golangci-lint-action@v7 + uses: golangci/golangci-lint-action@v9 with: version: v2.6.1 # LINT_VERSION: update version in other places - id: govulncheck From f00cba01b7779d1b0c7edb661ef219048470511c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sat, 8 Nov 2025 14:58:28 +0100 Subject: [PATCH 3/3] config --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index ab2b97d..2e94c79 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -144,7 +144,7 @@ linters: enable-all: true unparam: check-exported: true - wsl_v5: + wsl: force-err-cuddling: true exclusions: generated: lax