Skip to content

Commit efb2501

Browse files
authored
Migrate golangci-lint configuration to v2 and update GitHub Action (#2)
1 parent 6883252 commit efb2501

File tree

2 files changed

+71
-68
lines changed

2 files changed

+71
-68
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
TZ: "America/Chicago"
3232

3333
- name: golangci-lint
34-
uses: golangci/golangci-lint-action@v3
34+
uses: golangci/golangci-lint-action@v7
3535
with:
36-
version: latest
36+
version: v2.3.1
3737
skip-pkg-cache: true
3838

3939
- name: install goveralls

.golangci.yml

Lines changed: 69 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,81 @@
1-
linters-settings:
2-
govet:
3-
shadow: true
4-
gocyclo:
5-
min-complexity: 15
6-
maligned:
7-
suggest-new: true
8-
goconst:
9-
min-len: 2
10-
min-occurrences: 2
11-
misspell:
12-
locale: US
13-
lll:
14-
line-length: 140
15-
gocritic:
16-
enabled-tags:
17-
- performance
18-
- style
19-
- experimental
20-
disabled-checks:
21-
- wrapperFunc
22-
1+
version: "2"
2+
run:
3+
concurrency: 4
234
linters:
5+
default: none
246
enable:
25-
- staticcheck
26-
- revive
27-
- govet
28-
- unconvert
29-
- gosec
30-
- unparam
31-
- typecheck
32-
- ineffassign
33-
- stylecheck
34-
- gochecknoinits
35-
- copyloopvar
36-
- gocritic
37-
- nakedret
38-
- gosimple
39-
- prealloc
40-
- unused
417
- contextcheck
428
- copyloopvar
439
- decorder
4410
- errorlint
4511
- exptostd
4612
- gochecknoglobals
47-
- gofmt
48-
- goimports
13+
- gochecknoinits
14+
- gocritic
15+
- gosec
16+
- govet
17+
- ineffassign
18+
- nakedret
4919
- nilerr
20+
- prealloc
5021
- predeclared
22+
- revive
23+
- staticcheck
5124
- testifylint
5225
- thelper
53-
fast: false
54-
disable-all: true
55-
56-
57-
run:
58-
concurrency: 4
59-
60-
issues:
61-
exclude-rules:
62-
- text: "G114: Use of net/http serve function that has no support for setting timeouts"
63-
linters:
64-
- gosec
65-
- linters:
66-
- unparam
67-
- revive
68-
path: _test\.go$
69-
text: "unused-parameter"
70-
- linters:
71-
- prealloc
72-
path: _test\.go$
73-
text: "Consider pre-allocating"
74-
- linters:
75-
- gosec
76-
- intrange
77-
path: _test\.go$
78-
exclude-use-default: false
26+
- unconvert
27+
- unparam
28+
- unused
29+
settings:
30+
goconst:
31+
min-len: 2
32+
min-occurrences: 2
33+
gocritic:
34+
disabled-checks:
35+
- wrapperFunc
36+
enabled-tags:
37+
- performance
38+
- style
39+
- experimental
40+
gocyclo:
41+
min-complexity: 15
42+
govet:
43+
enable:
44+
- shadow
45+
lll:
46+
line-length: 140
47+
misspell:
48+
locale: US
49+
exclusions:
50+
generated: lax
51+
rules:
52+
- linters:
53+
- gosec
54+
text: 'G114: Use of net/http serve function that has no support for setting timeouts'
55+
- linters:
56+
- revive
57+
- unparam
58+
path: _test\.go$
59+
text: unused-parameter
60+
- linters:
61+
- prealloc
62+
path: _test\.go$
63+
text: Consider pre-allocating
64+
- linters:
65+
- gosec
66+
- intrange
67+
path: _test\.go$
68+
paths:
69+
- third_party$
70+
- builtin$
71+
- examples$
72+
formatters:
73+
enable:
74+
- gofmt
75+
- goimports
76+
exclusions:
77+
generated: lax
78+
paths:
79+
- third_party$
80+
- builtin$
81+
- examples$

0 commit comments

Comments
 (0)