@@ -59,13 +59,13 @@ func (l *Loader) Load() error {
59
59
60
60
l .applyStringSliceHack ()
61
61
62
- l .handleGoVersion ()
63
-
64
62
err = l .handleDeprecation ()
65
63
if err != nil {
66
64
return err
67
65
}
68
66
67
+ l .handleGoVersion ()
68
+
69
69
err = l .handleEnableOnlyOption ()
70
70
if err != nil {
71
71
return err
@@ -277,7 +277,7 @@ func (l *Loader) handleGoVersion() {
277
277
if l .cfg .LintersSettings .Gosimple .GoVersion == "" {
278
278
l .cfg .LintersSettings .Gosimple .GoVersion = trimmedGoVersion
279
279
}
280
- if l .cfg .LintersSettings .Stylecheck .GoVersion ! = "" {
280
+ if l .cfg .LintersSettings .Stylecheck .GoVersion = = "" {
281
281
l .cfg .LintersSettings .Stylecheck .GoVersion = trimmedGoVersion
282
282
}
283
283
}
@@ -322,14 +322,59 @@ func (l *Loader) handleDeprecation() error {
322
322
l .cfg .Output .Formats = f
323
323
}
324
324
325
+ l .handleLinterOptionDeprecations ()
326
+
327
+ return nil
328
+ }
329
+
330
+ func (l * Loader ) handleLinterOptionDeprecations () {
325
331
// Deprecated since v1.57.0,
326
332
// but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
327
333
if l .cfg .LintersSettings .Govet .CheckShadowing {
328
- l .warn ("The configuration option `govet.check-shadowing` is deprecated. " +
334
+ l .warn ("The configuration option `linters. govet.check-shadowing` is deprecated. " +
329
335
"Please enable `shadow` instead, if you are not using `enable-all`." )
330
336
}
331
337
332
- return nil
338
+ // Deprecated since v1.42.0.
339
+ if l .cfg .LintersSettings .Errcheck .Exclude != "" {
340
+ l .warn ("The configuration option `linters.errcheck.exclude` is deprecated, please use `linters.errcheck.exclude-functions`." )
341
+ }
342
+
343
+ // Deprecated since v1.44.0.
344
+ if l .cfg .LintersSettings .Gci .LocalPrefixes != "" {
345
+ l .warn ("The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`." )
346
+ }
347
+
348
+ // Deprecated since v1.33.0.
349
+ if l .cfg .LintersSettings .Godot .CheckAll {
350
+ l .warn ("The configuration option `linters.godot.check-all` is deprecated, please use `linters.godot.scope: all`." )
351
+ }
352
+
353
+ // Deprecated since v1.44.0.
354
+ if len (l .cfg .LintersSettings .Gomnd .Settings ) > 0 {
355
+ l .warn ("The configuration option `linters.gomnd.settings` is deprecated. Please use the options " +
356
+ "`linters.gomnd.checks`,`linters.gomnd.ignored-numbers`,`linters.gomnd.ignored-files`,`linters.gomnd.ignored-functions`." )
357
+ }
358
+
359
+ // Deprecated since v1.47.0
360
+ if l .cfg .LintersSettings .Gofumpt .LangVersion != "" {
361
+ l .warn ("The configuration option `linters.gofumpt.lang-version` is deprecated, please use global `run.go`." )
362
+ }
363
+
364
+ // Deprecated since v1.47.0
365
+ if l .cfg .LintersSettings .Staticcheck .GoVersion != "" {
366
+ l .warn ("The configuration option `linters.staticcheck.go` is deprecated, please use global `run.go`." )
367
+ }
368
+
369
+ // Deprecated since v1.47.0
370
+ if l .cfg .LintersSettings .Gosimple .GoVersion != "" {
371
+ l .warn ("The configuration option `linters.gosimple.go` is deprecated, please use global `run.go`." )
372
+ }
373
+
374
+ // Deprecated since v1.47.0
375
+ if l .cfg .LintersSettings .Stylecheck .GoVersion != "" {
376
+ l .warn ("The configuration option `linters.stylecheck.go` is deprecated, please use global `run.go`." )
377
+ }
333
378
}
334
379
335
380
func (l * Loader ) handleEnableOnlyOption () error {
0 commit comments