@@ -304,7 +304,6 @@ func (l *Loader) handleGoVersion() {
304304 os .Setenv ("GOSECGOVERSION" , l .cfg .Run .Go )
305305}
306306
307- //nolint:gocyclo // The complexity is expected by the cases to handle.
308307func (l * Loader ) handleDeprecation () error {
309308 if l .cfg .InternalTest || l .cfg .InternalCmdTest || os .Getenv (logutils .EnvTestRun ) == "1" {
310309 return nil
@@ -322,19 +321,17 @@ func (l *Loader) handleDeprecation() error {
322321 l .cfg .Issues .ExcludeDirs = l .cfg .Run .SkipDirs
323322 }
324323
325- // The 2 options are true by default.
326324 // Deprecated since v1.57.0
327- if ! l .cfg .Run .UseDefaultSkipDirs {
325+ if l .cfg .Run .UseDefaultSkipDirs != nil {
328326 l .log .Warnf ("The configuration option `run.skip-dirs-use-default` is deprecated, please use `issues.exclude-dirs-use-default`." )
327+ l .cfg .Issues .UseDefaultExcludeDirs = * l .cfg .Run .UseDefaultSkipDirs
329328 }
330- l .cfg .Issues .UseDefaultExcludeDirs = l .cfg .Run .UseDefaultSkipDirs && l .cfg .Issues .UseDefaultExcludeDirs
331329
332- // The 2 options are false by default.
333330 // Deprecated since v1.57.0
334- if l .cfg .Run .ShowStats {
331+ if l .cfg .Run .ShowStats != nil {
335332 l .log .Warnf ("The configuration option `run.show-stats` is deprecated, please use `output.show-stats`" )
333+ l .cfg .Output .ShowStats = * l .cfg .Run .ShowStats
336334 }
337- l .cfg .Output .ShowStats = l .cfg .Run .ShowStats || l .cfg .Output .ShowStats
338335
339336 // Deprecated since v1.63.0
340337 if l .cfg .Output .UniqByLine != nil {
@@ -363,9 +360,11 @@ func (l *Loader) handleDeprecation() error {
363360 }
364361
365362 // Deprecated since v1.59.0
366- if l .cfg .Issues .ExcludeGeneratedStrict {
363+ if l .cfg .Issues .ExcludeGeneratedStrict != nil {
367364 l .log .Warnf ("The configuration option `issues.exclude-generated-strict` is deprecated, please use `issues.exclude-generated`" )
368- l .cfg .Issues .ExcludeGenerated = "strict" // Don't use the constants to avoid cyclic dependencies.
365+ if ! * l .cfg .Issues .ExcludeGeneratedStrict {
366+ l .cfg .Issues .ExcludeGenerated = "strict" // Don't use the constants to avoid cyclic dependencies.
367+ }
369368 }
370369
371370 l .handleLinterOptionDeprecations ()
@@ -376,12 +375,12 @@ func (l *Loader) handleDeprecation() error {
376375func (l * Loader ) handleLinterOptionDeprecations () {
377376 // Deprecated since v1.57.0,
378377 // but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
379- if l .cfg .LintersSettings .Govet .CheckShadowing {
378+ if l .cfg .LintersSettings .Govet .CheckShadowing != nil {
380379 l .log .Warnf ("The configuration option `linters.govet.check-shadowing` is deprecated. " +
381380 "Please enable `shadow` instead, if you are not using `enable-all`." )
382381 }
383382
384- if l .cfg .LintersSettings .CopyLoopVar .IgnoreAlias {
383+ if l .cfg .LintersSettings .CopyLoopVar .IgnoreAlias != nil {
385384 l .log .Warnf ("The configuration option `linters.copyloopvar.ignore-alias` is deprecated and ignored," +
386385 "please use `linters.copyloopvar.check-alias`." )
387386 }
@@ -403,7 +402,7 @@ func (l *Loader) handleLinterOptionDeprecations() {
403402 }
404403
405404 // Deprecated since v1.33.0.
406- if l .cfg .LintersSettings .Godot .CheckAll {
405+ if l .cfg .LintersSettings .Godot .CheckAll != nil {
407406 l .log .Warnf ("The configuration option `linters.godot.check-all` is deprecated, please use `linters.godot.scope: all`." )
408407 }
409408
@@ -428,23 +427,23 @@ func (l *Loader) handleLinterOptionDeprecations() {
428427 }
429428
430429 // Deprecated since v1.60.0
431- if ! l .cfg .LintersSettings .Unused .ExportedIsUsed {
430+ if l .cfg .LintersSettings .Unused .ExportedIsUsed != nil {
432431 l .log .Warnf ("The configuration option `linters.unused.exported-is-used` is deprecated." )
433432 }
434433
435434 // Deprecated since v1.58.0
436- if l .cfg .LintersSettings .SlogLint .ContextOnly {
435+ if l .cfg .LintersSettings .SlogLint .ContextOnly != nil {
437436 l .log .Warnf ("The configuration option `linters.sloglint.context-only` is deprecated, please use `linters.sloglint.context`." )
438437 l .cfg .LintersSettings .SlogLint .Context = cmp .Or (l .cfg .LintersSettings .SlogLint .Context , "all" )
439438 }
440439
441440 // Deprecated since v1.51.0
442- if l .cfg .LintersSettings .UseStdlibVars .OSDevNull {
441+ if l .cfg .LintersSettings .UseStdlibVars .OSDevNull != nil {
443442 l .log .Warnf ("The configuration option `linters.usestdlibvars.os-dev-null` is deprecated." )
444443 }
445444
446445 // Deprecated since v1.51.0
447- if l .cfg .LintersSettings .UseStdlibVars .SyslogPriority {
446+ if l .cfg .LintersSettings .UseStdlibVars .SyslogPriority != nil {
448447 l .log .Warnf ("The configuration option `linters.usestdlibvars.syslog-priority` is deprecated." )
449448 }
450449}
0 commit comments