11
11
#
12
12
# See the file `.golangci.reference.yml` to have a list of all available configuration options.
13
13
14
+ version : " 2"
15
+
14
16
linters :
15
17
disable-all : true
16
18
# This list of linters is not a recommendation (same thing for all this configuration file).
@@ -31,8 +33,6 @@ linters:
31
33
- gocritic
32
34
- gocyclo
33
35
- godox
34
- - gofmt
35
- - goimports
36
36
- mnd
37
37
- goprintffuncname
38
38
- gosec
@@ -53,7 +53,68 @@ linters:
53
53
- unparam
54
54
- unused
55
55
- whitespace
56
+ exclusions :
57
+ presets :
58
+ - comments
59
+ - stdErrorHandling
60
+ - commonFalsePositives
61
+ - legacy
62
+ paths :
63
+ - test/testdata_etc # test files
64
+ - internal/go # extracted from Go code
65
+ - internal/x # extracted from x/tools code
66
+ - pkg/goformatters/gci/internal # extracted from gci code
67
+ - pkg/goanalysis/runner_checker.go # extracted from x/tools code
68
+ rules :
69
+ - path : (.+)_test\.go
70
+ linters :
71
+ - dupl
72
+ - mnd
73
+ - lll
74
+
75
+ # Deprecated linter options.
76
+ - path : pkg/golinters/errcheck/errcheck.go
77
+ linters : [staticcheck]
78
+ text : " SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
79
+ - path : pkg/golinters/errcheck/errcheck.go
80
+ linters : [staticcheck]
81
+ text : " SA1019: errCfg.Ignore is deprecated: use ExcludeFunctions instead"
82
+ - path : pkg/golinters/govet/govet.go
83
+ linters : [staticcheck]
84
+ text : " SA1019: cfg.CheckShadowing is deprecated: the linter should be enabled inside Enable."
85
+ - path : pkg/golinters/godot/godot.go
86
+ linters : [staticcheck]
87
+ text : " SA1019: settings.CheckAll is deprecated: use Scope instead"
88
+ - path : pkg/goformatters/gci/gci.go
89
+ linters : [staticcheck]
90
+ text : " SA1019: settings.LocalPrefixes is deprecated: use Sections instead."
56
91
92
+ # Related to `run.go`, it cannot be removed.
93
+ - path : pkg/golinters/gofumpt/gofumpt.go
94
+ linters : [staticcheck]
95
+ text : " SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
96
+
97
+ # Based on existing code, the modifications should be limited to make maintenance easier.
98
+ - path : pkg/golinters/unused/unused.go
99
+ linters : [gocritic]
100
+ text : " rangeValCopy: each iteration copies 160 bytes \\ (consider pointers or indexing\\ )"
101
+
102
+ # Related to the result of computation but divided multiple times by 1024.
103
+ - path : test/bench/bench_test.go
104
+ linters : [gosec]
105
+ text : " G115: integer overflow conversion uint64 -> int"
106
+
107
+ formatters :
108
+ enable :
109
+ - gofmt
110
+ - goimports
111
+ settings :
112
+ gofmt :
113
+ rewrite-rules :
114
+ - pattern : ' interface{}'
115
+ replacement : ' any'
116
+ goimports :
117
+ local-prefixes : github.com/golangci/golangci-lint
57
118
58
119
linters-settings :
59
120
depguard :
@@ -95,12 +156,6 @@ linters-settings:
95
156
godox :
96
157
keywords :
97
158
- FIXME
98
- gofmt :
99
- rewrite-rules :
100
- - pattern : ' interface{}'
101
- replacement : ' any'
102
- goimports :
103
- local-prefixes : github.com/golangci/golangci-lint
104
159
mnd :
105
160
# don't include the "operation" and "assign"
106
161
checks :
@@ -146,53 +201,5 @@ linters-settings:
146
201
- name : unused-parameter
147
202
- name : unused-receiver
148
203
149
- issues :
150
- exclude-rules :
151
- - path : (.+)_test\.go
152
- linters :
153
- - dupl
154
- - mnd
155
- - lll
156
-
157
- # Deprecated linter options.
158
- - path : pkg/golinters/errcheck/errcheck.go
159
- linters : [staticcheck]
160
- text : " SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
161
- - path : pkg/golinters/errcheck/errcheck.go
162
- linters : [staticcheck]
163
- text : " SA1019: errCfg.Ignore is deprecated: use ExcludeFunctions instead"
164
- - path : pkg/golinters/govet/govet.go
165
- linters : [staticcheck]
166
- text : " SA1019: cfg.CheckShadowing is deprecated: the linter should be enabled inside Enable."
167
- - path : pkg/golinters/godot/godot.go
168
- linters : [staticcheck]
169
- text : " SA1019: settings.CheckAll is deprecated: use Scope instead"
170
- - path : pkg/goformatters/gci/gci.go
171
- linters : [staticcheck]
172
- text : " SA1019: settings.LocalPrefixes is deprecated: use Sections instead."
173
-
174
- # Related to `run.go`, it cannot be removed.
175
- - path : pkg/golinters/gofumpt/gofumpt.go
176
- linters : [staticcheck]
177
- text : " SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
178
-
179
- # Based on existing code, the modifications should be limited to make maintenance easier.
180
- - path : pkg/golinters/unused/unused.go
181
- linters : [gocritic]
182
- text : " rangeValCopy: each iteration copies 160 bytes \\ (consider pointers or indexing\\ )"
183
-
184
- # Related to the result of computation but divided multiple times by 1024.
185
- - path : test/bench/bench_test.go
186
- linters : [gosec]
187
- text : " G115: integer overflow conversion uint64 -> int"
188
-
189
- exclude-dirs :
190
- - test/testdata_etc # test files
191
- - internal/go # extracted from Go code
192
- - internal/x # extracted from x/tools code
193
- - pkg/goformatters/gci/internal # extracted from gci code
194
- exclude-files :
195
- - pkg/goanalysis/runner_checker.go # extracted from x/tools code
196
-
197
204
run :
198
205
timeout : 5m
0 commit comments