diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 086a60c..27388b5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,8 +14,8 @@ 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.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..2e94c79 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: 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 "" }