From 8cab185e57b5a0366176efab6f184e0063f56364 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Thu, 14 Aug 2025 11:00:18 +0200 Subject: [PATCH 1/4] Update golangci-lint --- README.md | 2 +- makefiles/base.mk | 2 +- scripts/lint.sh | 2 +- templates/github/workflows/golangci-lint.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b3d20af..d9d0d08 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project. Add `Makefile` to your module with includes standard targets. ```Makefile -#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version. +#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version. # The head of Makefile determines location of dev-go to include standard targets. GO ?= go diff --git a/makefiles/base.mk b/makefiles/base.mk index 8b4c583..deac7a6 100644 --- a/makefiles/base.mk +++ b/makefiles/base.mk @@ -1,4 +1,4 @@ -#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version. +#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version. # The head of Makefile determines location of dev-go to include standard targets. GO ?= go diff --git a/scripts/lint.sh b/scripts/lint.sh index 93c8e2b..fbc19a3 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash [ -z "$GO" ] && GO=go -[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.64.5" +[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.3.1" # detecting GOPATH and removing trailing "/" if any GOPATH="$(go env GOPATH)" diff --git a/templates/github/workflows/golangci-lint.yml b/templates/github/workflows/golangci-lint.yml index a3b265d..3b8fcd5 100644 --- a/templates/github/workflows/golangci-lint.yml +++ b/templates/github/workflows/golangci-lint.yml @@ -24,10 +24,10 @@ jobs: go-version: stable - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v6.5.0 + uses: golangci/golangci-lint-action@v8.0.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.64.5 + version: v2.3.1 # Optional: working directory, useful for monorepos # working-directory: somedir From 6be4081a1e2713b5b7ac835516f4feda3069b992 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sun, 17 Aug 2025 20:24:23 +0200 Subject: [PATCH 2/4] Update golangci-lint --- scripts/.golangci.yml | 116 +++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/scripts/.golangci.yml b/scripts/.golangci.yml index 86f78e7..5a75614 100644 --- a/scripts/.golangci.yml +++ b/scripts/.golangci.yml @@ -1,62 +1,76 @@ -# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml +version: "2" run: tests: true - -linters-settings: - errcheck: - check-type-assertions: true - check-blank: true - gocyclo: - min-complexity: 20 - dupl: - threshold: 100 - misspell: - locale: US - unparam: - check-exported: true - linters: - enable-all: true + default: all disable: - - intrange + - wsl_v5 + - funcorder - copyloopvar - - lll - - gochecknoglobals - - wrapcheck - - paralleltest + - depguard + - dupword + - errname + - exhaustruct - forbidigo - forcetypeassert - - varnamelen - - tagliatelle - - errname + - gochecknoglobals + - intrange - ireturn - - exhaustruct + - lll + - mnd - nonamedreturns - - testableexamples - - dupword - - depguard + - paralleltest + - recvcheck - tagalign - - mnd + - tagliatelle + - testableexamples - testifylint - - recvcheck - -issues: - exclude-use-default: false - exclude-rules: - - linters: - - mnd - - goconst - - noctx - - funlen - - dupl - - unused - - unparam - path: "_test.go" - - linters: - - errcheck # Error checking omitted for brevity. - - gosec - path: "example_" - - linters: - - revive - text: "unused-parameter: parameter" - + - varnamelen + - wrapcheck + settings: + dupl: + threshold: 100 + errcheck: + check-type-assertions: true + check-blank: true + gocyclo: + min-complexity: 20 + misspell: + locale: US + unparam: + check-exported: true + exclusions: + generated: lax + rules: + - linters: + - dupl + - funlen + - goconst + - mnd + - noctx + - unparam + - unused + path: _test.go + - linters: + - errcheck + - gosec + path: example_ + - linters: + - revive + text: 'unused-parameter: parameter' + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gci + - gofmt + - gofumpt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ From d655557679d3611981f4361ee1f2758f84540172 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sun, 17 Aug 2025 20:26:16 +0200 Subject: [PATCH 3/4] Update golangci-lint --- templates/github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/github/workflows/golangci-lint.yml b/templates/github/workflows/golangci-lint.yml index 3b8fcd5..f435fe8 100644 --- a/templates/github/workflows/golangci-lint.yml +++ b/templates/github/workflows/golangci-lint.yml @@ -27,7 +27,7 @@ jobs: uses: golangci/golangci-lint-action@v8.0.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v2.3.1 + version: v2.4.0 # Optional: working directory, useful for monorepos # working-directory: somedir From a3f5179f3e23832184f27192eb456ed4d10e5133 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sun, 17 Aug 2025 20:27:37 +0200 Subject: [PATCH 4/4] Update golangci-lint --- scripts/.golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/.golangci.yml b/scripts/.golangci.yml index 5a75614..af4de1c 100644 --- a/scripts/.golangci.yml +++ b/scripts/.golangci.yml @@ -1,3 +1,4 @@ +# See https://golangci-lint.run/docs/linters/configuration/ version: "2" run: tests: true