Skip to content

Commit 9bc661a

Browse files
committed
.golangci.yml: migrate to golangci-lint v2.
1 parent 4dbf3e7 commit 9bc661a

File tree

2 files changed

+63
-65
lines changed

2 files changed

+63
-65
lines changed

.github/workflows/golang-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: actions/setup-go@v5
22+
- uses: actions/setup-go@v8
2323
with:
2424
go-version: '>=1.21'
2525
cache: false

.golangci.yml

Lines changed: 62 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
1+
version: "2"
12
linters:
2-
enable-all: true
3+
default: all
34
disable:
4-
# deprecated
5-
#- deadcode
6-
#- execinquery
7-
#- exhaustivestruct
8-
#- exportloopref
9-
#- golint
10-
#- gomnd
11-
#- ifshort
12-
#- interfacer
13-
#- maligned
14-
#- nosnakecase
15-
#- scopelint
16-
#- structcheck
17-
- tenv
18-
#- varcheck
195
# just whining
206
- copyloopvar # go>=1.22
217
- cyclop
228
- dupword
239
- forbidigo
2410
- funlen
25-
- gci
2611
- gochecknoglobals
2712
- gochecknoinits
2813
- gocognit
2914
- gocritic
3015
- gocyclo
3116
- godot
32-
- gofmt
33-
- gofumpt
34-
- goimports
3517
- intrange # go>=1.22
3618
- lll
3719
- mnd
3820
- nestif
3921
- nlreturn
40-
- stylecheck
4122
- varnamelen
4223
- whitespace
4324
- wsl
@@ -52,46 +33,63 @@ linters:
5233
- perfsprint
5334
- testpackage
5435
# 78 active linters remaining including gosec, gosimple, govet, etc.
55-
56-
linters-settings:
57-
revive:
58-
enable-all-rules: true
59-
rules:
60-
- name: add-constant
61-
disabled: true
62-
- name: argument-limit
63-
disabled: true
64-
- name: cognitive-complexity # similar to 'gocognit' above
65-
disabled: true
66-
- name: cyclomatic # similar to 'cyclop' & 'gocyclo' above
67-
disabled: true
68-
- name: empty-block
69-
disabled: true
70-
- name: empty-lines
71-
disabled: true
72-
- name: flag-parameter
73-
disabled: true
74-
- name: function-length # similar to 'funlen' above
75-
disabled: true
76-
- name: function-result-limit
77-
disabled: true
78-
- name: increment-decrement
79-
disabled: true
80-
- name: line-length-limit # similar to 'lll' above
81-
disabled: true
82-
- name: max-public-structs
83-
disabled: true
84-
- name: receiver-naming
85-
disabled: true
86-
- name: var-naming
87-
disabled: true
88-
- name: unchecked-type-assertion # similar to 'forcetypeassert' above
89-
disabled: true
90-
- name: unexported-naming
91-
disabled: true
92-
- name: unhandled-error
93-
arguments:
94-
- "fmt.Println"
95-
- "fmt.Printf"
96-
- name: use-any # applicable to go>=1.18 only
97-
disabled: true
36+
settings:
37+
revive:
38+
enable-all-rules: true
39+
rules:
40+
- name: add-constant
41+
disabled: true
42+
- name: argument-limit
43+
disabled: true
44+
- name: cognitive-complexity # similar to 'gocognit' above
45+
disabled: true
46+
- name: cyclomatic # similar to 'cyclop' & 'gocyclo' above
47+
disabled: true
48+
- name: empty-block
49+
disabled: true
50+
- name: empty-lines
51+
disabled: true
52+
- name: flag-parameter
53+
disabled: true
54+
- name: function-length # similar to 'funlen' above
55+
disabled: true
56+
- name: function-result-limit
57+
disabled: true
58+
- name: increment-decrement
59+
disabled: true
60+
- name: line-length-limit # similar to 'lll' above
61+
disabled: true
62+
- name: max-public-structs
63+
disabled: true
64+
- name: receiver-naming
65+
disabled: true
66+
- name: var-naming
67+
disabled: true
68+
- name: unchecked-type-assertion # similar to 'forcetypeassert' above
69+
disabled: true
70+
- name: unexported-naming
71+
disabled: true
72+
- name: unhandled-error
73+
arguments:
74+
- fmt.Println
75+
- fmt.Printf
76+
- name: use-any # applicable to go>=1.18 only
77+
disabled: true
78+
exclusions:
79+
generated: lax
80+
presets:
81+
- comments
82+
- common-false-positives
83+
- legacy
84+
- std-error-handling
85+
paths:
86+
- third_party$
87+
- builtin$
88+
- examples$
89+
formatters:
90+
exclusions:
91+
generated: lax
92+
paths:
93+
- third_party$
94+
- builtin$
95+
- examples$

0 commit comments

Comments
 (0)