Skip to content

Commit 662b762

Browse files
authored
Update golangci-lint (#66)
1 parent d072fbe commit 662b762

5 files changed

Lines changed: 71 additions & 56 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
2626
Add `Makefile` to your module with includes standard targets.
2727

2828
```Makefile
29-
#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version.
29+
#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version.
3030

3131
# The head of Makefile determines location of dev-go to include standard targets.
3232
GO ?= go

makefiles/base.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version.
1+
#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version.
22

33
# The head of Makefile determines location of dev-go to include standard targets.
44
GO ?= go

scripts/.golangci.yml

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,77 @@
1-
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
1+
# See https://golangci-lint.run/docs/linters/configuration/
2+
version: "2"
23
run:
34
tests: true
4-
5-
linters-settings:
6-
errcheck:
7-
check-type-assertions: true
8-
check-blank: true
9-
gocyclo:
10-
min-complexity: 20
11-
dupl:
12-
threshold: 100
13-
misspell:
14-
locale: US
15-
unparam:
16-
check-exported: true
17-
185
linters:
19-
enable-all: true
6+
default: all
207
disable:
21-
- intrange
8+
- wsl_v5
9+
- funcorder
2210
- copyloopvar
23-
- lll
24-
- gochecknoglobals
25-
- wrapcheck
26-
- paralleltest
11+
- depguard
12+
- dupword
13+
- errname
14+
- exhaustruct
2715
- forbidigo
2816
- forcetypeassert
29-
- varnamelen
30-
- tagliatelle
31-
- errname
17+
- gochecknoglobals
18+
- intrange
3219
- ireturn
33-
- exhaustruct
20+
- lll
21+
- mnd
3422
- nonamedreturns
35-
- testableexamples
36-
- dupword
37-
- depguard
23+
- paralleltest
24+
- recvcheck
3825
- tagalign
39-
- mnd
26+
- tagliatelle
27+
- testableexamples
4028
- testifylint
41-
- recvcheck
42-
43-
issues:
44-
exclude-use-default: false
45-
exclude-rules:
46-
- linters:
47-
- mnd
48-
- goconst
49-
- noctx
50-
- funlen
51-
- dupl
52-
- unused
53-
- unparam
54-
path: "_test.go"
55-
- linters:
56-
- errcheck # Error checking omitted for brevity.
57-
- gosec
58-
path: "example_"
59-
- linters:
60-
- revive
61-
text: "unused-parameter: parameter"
62-
29+
- varnamelen
30+
- wrapcheck
31+
settings:
32+
dupl:
33+
threshold: 100
34+
errcheck:
35+
check-type-assertions: true
36+
check-blank: true
37+
gocyclo:
38+
min-complexity: 20
39+
misspell:
40+
locale: US
41+
unparam:
42+
check-exported: true
43+
exclusions:
44+
generated: lax
45+
rules:
46+
- linters:
47+
- dupl
48+
- funlen
49+
- goconst
50+
- mnd
51+
- noctx
52+
- unparam
53+
- unused
54+
path: _test.go
55+
- linters:
56+
- errcheck
57+
- gosec
58+
path: example_
59+
- linters:
60+
- revive
61+
text: 'unused-parameter: parameter'
62+
paths:
63+
- third_party$
64+
- builtin$
65+
- examples$
66+
formatters:
67+
enable:
68+
- gci
69+
- gofmt
70+
- gofumpt
71+
- goimports
72+
exclusions:
73+
generated: lax
74+
paths:
75+
- third_party$
76+
- builtin$
77+
- examples$

scripts/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
[ -z "$GO" ] && GO=go
4-
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.64.5"
4+
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.3.1"
55

66
# detecting GOPATH and removing trailing "/" if any
77
GOPATH="$(go env GOPATH)"

templates/github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
go-version: stable
2525
- uses: actions/checkout@v4
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v6.5.0
27+
uses: golangci/golangci-lint-action@v8.0.0
2828
with:
2929
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
30-
version: v1.64.5
30+
version: v2.4.0
3131

3232
# Optional: working directory, useful for monorepos
3333
# working-directory: somedir

0 commit comments

Comments
 (0)