diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 036127b..dc1a8a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,4 @@ jobs: with: go-version-file: "go.mod" cache: false # Use golangci-lint-action cache instead. - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.56 + - uses: golangci/golangci-lint-action@v9 diff --git a/.golangci.yml b/.golangci.yml index 171f33d..ef6a31d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,40 +1,61 @@ +version: "2" run: - timeout: 5m tests: true - skip-dirs: - - .github - skip-files: - - ".*_gen.go$" -output: - sort-results: true -linters: # https://golangci-lint.run/usage/linters/ - enable-all: true +linters: + default: all disable: - depguard - - forbidigo + - err113 # Use errorlint instead. - exhaustruct + - forbidigo - nlreturn + - noinlineerr - paralleltest - testableexamples - - varnamelen - - wrapcheck - - goerr113 # Use errorlint instead. - - gofmt # Use gofumpt instead. - testpackage - tparallel # Use paralleltest instead. + - varnamelen + - wrapcheck - wsl - - deadcode # deprecated - - exhaustivestruct # deprecated - - golint # deprecated - - ifshort # deprecated - - interfacer # deprecated - - maligned # deprecated - - nosnakecase # deprecated - - scopelint # deprecated - - structcheck # deprecated - - varcheck # deprecated -issues: - exclude-rules: - - path: _test\.go - linters: - - funlen + - wsl_v5 + # v1 deprecated linters (removed in v2; no longer valid disable targets): + # - deadcode # deprecated + # - exhaustivestruct # deprecated + # - golint # deprecated + # - ifshort # deprecated + # - interfacer # deprecated + # - maligned # deprecated + # - nosnakecase # deprecated + # - scopelint # deprecated + # - structcheck # deprecated + # - varcheck # deprecated + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - funlen + path: _test\.go + paths: + - third_party$ + - builtin$ + - examples$ + - ^\.github/ + - .*_gen\.go$ +formatters: + enable: + - gci + - gofumpt # Use gofumpt instead. + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ + - ^\.github/ + - .*_gen\.go$ diff --git a/go.mod b/go.mod index abe4547..01ceaea 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,5 @@ module github.com/ichizero/errlog -go 1.22 +go 1.24.0 + +toolchain go1.26.0