diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 855b020..76fdc1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: go-version: "1.26.2" # update together with dev.dockerfile - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: - version: "v2.11.4" # update together with dev.dockerfile + version: "v2.12.1" # update together with dev.dockerfile lint-latest-deps: runs-on: ubuntu-latest @@ -77,7 +77,7 @@ jobs: - run: make apply-latest-deps - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: - version: "v2.11.4" # update together with dev.dockerfile + version: "v2.12.1" # update together with dev.dockerfile check-tidy: name: go mod tidy diff --git a/.golangci.yml b/.golangci.yml index 8e65a6e..412a5d4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,6 +40,7 @@ linters: - bidichk # checks for dangerous unicode character sequences - bodyclose # checks whether HTTP response body is closed successfully - canonicalheader # checks whether net/http.Header uses canonical header + - clickhouselint # detects common mistakes with the ClickHouse native Go driver API - copyloopvar # detects places where loop variables are copied (Go 1.22+) - cyclop # checks function and package cyclomatic complexity - depguard # checks if package imports are in a list of acceptable packages @@ -90,6 +91,7 @@ linters: - nolintlint # reports ill-formed or insufficient nolint directives - nonamedreturns # reports all named returns - nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL + - paralleltest # detects missing usage of t.Parallel() method in your Go test - perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative - predeclared # finds code that shadows one of Go's predeclared identifiers - promlinter # checks Prometheus metrics naming via promlint @@ -146,7 +148,6 @@ linters: #- maintidx # measures the maintainability index of each function #- misspell # [useless] finds commonly misspelled English words in comments #- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity - #- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test #- tagliatelle # checks the struct tags #- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers #- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines @@ -391,21 +392,15 @@ linters: - github.com/jmoiron/sqlx sloglint: - # Enforce not using global loggers. - # Values: - # - "": disabled - # - "all": report all global loggers - # - "default": report only the default slog logger - # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global - # Default: "" + # Report the use of global loggers. + # https://github.com/go-simpler/sloglint#no-global-logger + # Values: "all", "default" + # Default: "" (disabled) no-global: all - # Enforce using methods that accept a context. - # Values: - # - "": disabled - # - "all": report all contextless calls - # - "scope": report only if a context exists in the scope of the outermost function - # https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only - # Default: "" + # Report the use of functions without a context.Context. + # https://github.com/go-simpler/sloglint#context-only + # Values: "all", "scope" + # Default: "" (disabled) context: scope staticcheck: diff --git a/dev.dockerfile b/dev.dockerfile index 0e3bf4b..f222433 100644 --- a/dev.dockerfile +++ b/dev.dockerfile @@ -2,7 +2,7 @@ FROM golang:1.26.2 AS go # update together with .github/workflows/ci.yml -FROM golangci/golangci-lint:v2.11.4 AS linter +FROM golangci/golangci-lint:v2.12.1 AS linter FROM go AS dev ENV INSIDE_DEV_CONTAINER=1 diff --git a/pkg/testableexamples/testableexamples_test.go b/pkg/testableexamples/testableexamples_test.go index 1eac829..24dc258 100644 --- a/pkg/testableexamples/testableexamples_test.go +++ b/pkg/testableexamples/testableexamples_test.go @@ -10,6 +10,7 @@ import ( ) func TestAnalyzer(t *testing.T) { + t.Parallel() // dir is named `testfiles` not `testdata` to be able to run examples with `make test` testdata, err := filepath.Abs("testfiles") if err != nil {