@@ -301,8 +301,6 @@ func (l *Loader) applyStringSliceHack() {
301301 l .appendStringSlice ("build-tags" , & l .cfg .Run .BuildTags )
302302 l .appendStringSlice ("exclude" , & l .cfg .Issues .ExcludePatterns )
303303
304- l .appendStringSlice ("skip-dirs" , & l .cfg .Run .SkipDirs )
305- l .appendStringSlice ("skip-files" , & l .cfg .Run .SkipFiles )
306304 l .appendStringSlice ("exclude-dirs" , & l .cfg .Issues .ExcludeDirs )
307305 l .appendStringSlice ("exclude-files" , & l .cfg .Issues .ExcludeFiles )
308306}
@@ -323,8 +321,8 @@ func (l *Loader) handleGoVersion() {
323321
324322 l .cfg .LintersSettings .ParallelTest .Go = l .cfg .Run .Go
325323
326- l .cfg .LintersSettings .GoFumpt .LangVersion = cmp . Or ( l .cfg .LintersSettings . GoFumpt . LangVersion , l . cfg . Run .Go )
327- l .cfg .Formatters .Settings .GoFumpt .LangVersion = cmp . Or ( l .cfg .Formatters . Settings . GoFumpt . LangVersion , l . cfg . Run .Go )
324+ l .cfg .LintersSettings .GoFumpt .LangVersion = l .cfg .Run .Go
325+ l .cfg .Formatters .Settings .GoFumpt .LangVersion = l .cfg .Run .Go
328326
329327 trimmedGoVersion := goutil .TrimGoVersion (l .cfg .Run .Go )
330328
@@ -340,123 +338,13 @@ func (l *Loader) handleDeprecation() error {
340338 return nil
341339 }
342340
343- // Deprecated since v1.57.0
344- if len (l .cfg .Run .SkipFiles ) > 0 {
345- l .log .Warnf ("The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`." )
346- l .cfg .Issues .ExcludeFiles = l .cfg .Run .SkipFiles
347- }
348-
349- // Deprecated since v1.57.0
350- if len (l .cfg .Run .SkipDirs ) > 0 {
351- l .log .Warnf ("The configuration option `run.skip-dirs` is deprecated, please use `issues.exclude-dirs`." )
352- l .cfg .Issues .ExcludeDirs = l .cfg .Run .SkipDirs
353- }
354-
355- // Deprecated since v1.57.0
356- if l .cfg .Run .UseDefaultSkipDirs != nil {
357- l .log .Warnf ("The configuration option `run.skip-dirs-use-default` is deprecated, please use `issues.exclude-dirs-use-default`." )
358- l .cfg .Issues .UseDefaultExcludeDirs = * l .cfg .Run .UseDefaultSkipDirs
359- }
360-
361- // Deprecated since v1.57.0
362- if l .cfg .Run .ShowStats != nil {
363- l .log .Warnf ("The configuration option `run.show-stats` is deprecated, please use `output.show-stats`" )
364- l .cfg .Output .ShowStats = * l .cfg .Run .ShowStats
365- }
366-
367- // Deprecated since v1.63.0
368- if l .cfg .Output .UniqByLine != nil {
369- l .log .Warnf ("The configuration option `output.uniq-by-line` is deprecated, please use `issues.uniq-by-line`" )
370- l .cfg .Issues .UniqByLine = * l .cfg .Output .UniqByLine
371- }
372-
373- // Deprecated since v1.59.0
374- if l .cfg .Issues .ExcludeGeneratedStrict != nil {
375- l .log .Warnf ("The configuration option `issues.exclude-generated-strict` is deprecated, please use `issues.exclude-generated`" )
376- if ! * l .cfg .Issues .ExcludeGeneratedStrict {
377- l .cfg .Issues .ExcludeGenerated = "strict" // Don't use the constants to avoid cyclic dependencies.
378- }
379- }
380-
381341 l .handleLinterOptionDeprecations ()
382342
383343 return nil
384344}
385345
386- func (l * Loader ) handleLinterOptionDeprecations () {
387- // Deprecated since v1.57.0,
388- // but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
389- if l .cfg .LintersSettings .Govet .CheckShadowing != nil {
390- l .log .Warnf ("The configuration option `linters.govet.check-shadowing` is deprecated. " +
391- "Please enable `shadow` instead, if you are not using `enable-all`." )
392- }
393-
394- if l .cfg .LintersSettings .CopyLoopVar .IgnoreAlias != nil {
395- l .log .Warnf ("The configuration option `linters.copyloopvar.ignore-alias` is deprecated and ignored," +
396- "please use `linters.copyloopvar.check-alias`." )
397- }
398-
399- // Deprecated since v1.42.0.
400- if l .cfg .LintersSettings .Errcheck .Exclude != "" {
401- l .log .Warnf ("The configuration option `linters.errcheck.exclude` is deprecated, please use `linters.errcheck.exclude-functions`." )
402- }
403-
404- // Deprecated since v1.59.0,
405- // but it was unofficially deprecated since v1.13 (2018) (https://github.com/golangci/golangci-lint/pull/332).
406- if l .cfg .LintersSettings .Errcheck .Ignore != "" {
407- l .log .Warnf ("The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`." )
408- }
409-
410- // Deprecated since v1.44.0.
411- if l .cfg .LintersSettings .Gci .LocalPrefixes != "" {
412- l .log .Warnf ("The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`." )
413- }
414-
415- // Deprecated since v1.33.0.
416- if l .cfg .LintersSettings .Godot .CheckAll != nil {
417- l .log .Warnf ("The configuration option `linters.godot.check-all` is deprecated, please use `linters.godot.scope: all`." )
418- }
419-
420- // Deprecated since v1.47.0
421- if l .cfg .LintersSettings .GoFumpt .LangVersion != "" {
422- l .log .Warnf ("The configuration option `linters.gofumpt.lang-version` is deprecated, please use global `run.go`." )
423- }
424-
425- // Deprecated since v1.47.0
426- if l .cfg .LintersSettings .Staticcheck .GoVersion != "" {
427- l .log .Warnf ("The configuration option `linters.staticcheck.go` is deprecated, please use global `run.go`." )
428- }
429-
430- // Deprecated since v1.47.0
431- if l .cfg .LintersSettings .Gosimple .GoVersion != "" {
432- l .log .Warnf ("The configuration option `linters.gosimple.go` is deprecated, please use global `run.go`." )
433- }
434-
435- // Deprecated since v1.47.0
436- if l .cfg .LintersSettings .Stylecheck .GoVersion != "" {
437- l .log .Warnf ("The configuration option `linters.stylecheck.go` is deprecated, please use global `run.go`." )
438- }
439-
440- // Deprecated since v1.60.0
441- if l .cfg .LintersSettings .Unused .ExportedIsUsed != nil {
442- l .log .Warnf ("The configuration option `linters.unused.exported-is-used` is deprecated." )
443- }
444-
445- // Deprecated since v1.58.0
446- if l .cfg .LintersSettings .SlogLint .ContextOnly != nil {
447- l .log .Warnf ("The configuration option `linters.sloglint.context-only` is deprecated, please use `linters.sloglint.context`." )
448- l .cfg .LintersSettings .SlogLint .Context = cmp .Or (l .cfg .LintersSettings .SlogLint .Context , "all" )
449- }
450-
451- // Deprecated since v1.51.0
452- if l .cfg .LintersSettings .UseStdlibVars .OSDevNull != nil {
453- l .log .Warnf ("The configuration option `linters.usestdlibvars.os-dev-null` is deprecated." )
454- }
455-
456- // Deprecated since v1.51.0
457- if l .cfg .LintersSettings .UseStdlibVars .SyslogPriority != nil {
458- l .log .Warnf ("The configuration option `linters.usestdlibvars.syslog-priority` is deprecated." )
459- }
346+ func (* Loader ) handleLinterOptionDeprecations () {
347+ // The function is empty but deprecations will happen in the future.
460348}
461349
462350func (l * Loader ) handleEnableOnlyOption () error {
@@ -519,18 +407,9 @@ func (l *Loader) handleFormatterExclusions() {
519407 })
520408 }
521409}
522- func (l * Loader ) handleFormatterDeprecations () {
523- // Deprecated since v1.44.0.
524- if l .cfg .Formatters .Settings .Gci .LocalPrefixes != "" {
525- l .log .Warnf ("The configuration option `formatters.settings.gci.local-prefixes` is deprecated, " +
526- "please use `prefix()` inside `formatters.settings.gci.sections`." )
527- }
528410
529- // Deprecated since v1.47.0
530- if l .cfg .Formatters .Settings .GoFumpt .LangVersion != "" {
531- l .log .Warnf ("The configuration option `formatters.settings.gofumpt.lang-version` is deprecated, " +
532- "please use global `run.go`." )
533- }
411+ func (* Loader ) handleFormatterDeprecations () {
412+ // The function is empty but deprecations will happen in the future.
534413}
535414
536415func customDecoderHook () viper.DecoderConfigOption {
0 commit comments