From 304e22d632a0f14e9072576fa50c7dc10e3bdf32 Mon Sep 17 00:00:00 2001 From: Tom Godkin Date: Wed, 26 Mar 2025 22:39:18 +0000 Subject: [PATCH] Use golangci-lint v2 --- .github/workflows/test.yaml | 2 +- .golangci.yml | 67 +++++++++++++++++++++++-------------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7bb3e05..70cd9b1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: cache: false - run: make check env: { SKIP_LINT: true } - - uses: golangci/golangci-lint-action@v6 + - uses: golangci/golangci-lint-action@v7 with: { version: "latest" } - run: make cov - uses: codecov/codecov-action@v5 diff --git a/.golangci.yml b/.golangci.yml index d91ddd6..514d460 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,41 +1,58 @@ -run: { timeout: 3m } - -linters-settings: - cyclop: - max-complexity: 15 - package-average: 0.5 - skip-tests: false - - govet: { enable-all: true } - - misspell: { locale: US } - - depguard: - rules: - main: { allow: ["$gostd", "github.com/BooleanCat/go-functional/v2"] } - +version: "2" linters: - disable-all: true + default: none enable: - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - unused - asasalint - asciicheck - bidichk - decorder - depguard - durationcheck + - errcheck - errchkjson - errorlint - exhaustive - gochecknoglobals - gocritic + - gocyclo - gosec + - govet + - ineffassign + - misspell - nilerr + - staticcheck + - unused + settings: + cyclop: + max-complexity: 15 + package-average: 0.5 + depguard: + rules: + main: + allow: + - $gostd + - github.com/BooleanCat/go-functional/v2 + govet: + enable-all: true + misspell: + locale: US + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: - gofmt - - gocyclo - - misspell + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$