Skip to content

Commit 386f46c

Browse files
committed
chore: manage exclusions
1 parent 41a1013 commit 386f46c

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.golangci.yml

+21-8
Original file line numberDiff line numberDiff line change
@@ -143,36 +143,48 @@ linters:
143143
# See the comment on top of this file.
144144

145145
issues:
146-
# Excluding configuration per-path, per-linter, per-text and per-source
147146
exclude-rules:
148147
- path: (.+)_test\.go
149148
linters:
150149
- dupl
151150
- gomnd
152151
- lll
153152

153+
# The logic of creating a linter is similar between linters, it's not duplication.
154154
- path: pkg/golinters
155155
linters:
156156
- dupl
157157

158+
# Deprecated configuration options.
159+
- path: pkg/commands/run.go
160+
linters: [staticcheck]
161+
text: "SA1019: c.cfg.Run.ShowStats is deprecated: use Output.ShowStats instead."
162+
- path: pkg/commands/config.go
163+
text: "SA1019: cfg.Run.UseDefaultSkipDirs is deprecated: use Issues.UseDefaultExcludeDirs instead."
164+
165+
# Deprecated linter options.
158166
- path: pkg/golinters/errcheck.go
159167
linters: [staticcheck]
160168
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
161169
- path: pkg/commands/run.go
162170
linters: [staticcheck]
163171
text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead"
164-
- path: pkg/commands/run.go
165-
linters: [staticcheck]
166-
text: "SA1019: c.cfg.Run.ShowStats is deprecated: use Output.ShowStats instead."
167172
- path: pkg/golinters/govet.go
168173
text: "SA1019: cfg.CheckShadowing is deprecated: the linter should be enabled inside `Enable`."
169-
- path: pkg/commands/config.go
170-
text: "SA1019: cfg.Run.UseDefaultSkipDirs is deprecated: use Issues.UseDefaultExcludeDirs instead."
171-
172174
- path: pkg/golinters/godot.go
173175
linters: [staticcheck]
174-
text: "SA1019: settings.CheckAll is deprecated: use `Scope` instead"
176+
text: "SA1019: settings.CheckAll is deprecated: use Scope instead"
177+
- path: pkg/golinters/gci.go
178+
linters: [staticcheck]
179+
text: "SA1019: settings.LocalPrefixes is deprecated: use Sections instead."
180+
- path: pkg/golinters/gomnd.go
181+
linters: [staticcheck]
182+
text: "SA1019: settings.Settings is deprecated: use root level settings instead."
183+
- path: pkg/golinters/gomnd.go
184+
linters: [staticcheck]
185+
text: "SA1019: settings.Settings is deprecated: use root level settings instead."
175186

187+
# Related to `run.go`, it cannot be removed.
176188
- path: pkg/golinters/gofumpt.go
177189
linters: [staticcheck]
178190
text: "SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
@@ -183,6 +195,7 @@ issues:
183195
linters: [staticcheck]
184196
text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead."
185197

198+
# Based on existing code, the modifications should be limited to make maintenance easier.
186199
- path: pkg/golinters/unused.go
187200
linters: [gocritic]
188201
text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)"

0 commit comments

Comments
 (0)