@@ -59,13 +59,13 @@ func (l *Loader) Load() error {
5959
6060 l .applyStringSliceHack ()
6161
62- l .handleGoVersion ()
63-
6462 err = l .handleDeprecation ()
6563 if err != nil {
6664 return err
6765 }
6866
67+ l .handleGoVersion ()
68+
6969 err = l .handleEnableOnlyOption ()
7070 if err != nil {
7171 return err
@@ -277,7 +277,7 @@ func (l *Loader) handleGoVersion() {
277277 if l .cfg .LintersSettings .Gosimple .GoVersion == "" {
278278 l .cfg .LintersSettings .Gosimple .GoVersion = trimmedGoVersion
279279 }
280- if l .cfg .LintersSettings .Stylecheck .GoVersion ! = "" {
280+ if l .cfg .LintersSettings .Stylecheck .GoVersion = = "" {
281281 l .cfg .LintersSettings .Stylecheck .GoVersion = trimmedGoVersion
282282 }
283283}
@@ -322,14 +322,59 @@ func (l *Loader) handleDeprecation() error {
322322 l .cfg .Output .Formats = f
323323 }
324324
325+ l .handleLinterOptionDeprecations ()
326+
327+ return nil
328+ }
329+
330+ func (l * Loader ) handleLinterOptionDeprecations () {
325331 // Deprecated since v1.57.0,
326332 // but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
327333 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. " +
329335 "Please enable `shadow` instead, if you are not using `enable-all`." )
330336 }
331337
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+ }
333378}
334379
335380func (l * Loader ) handleEnableOnlyOption () error {
0 commit comments