File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed
Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -1074,10 +1074,6 @@ linters-settings:
10741074 - Katakana
10751075
10761076 govet :
1077- # Report about shadowed variables.
1078- # Default: false
1079- check-shadowing : true
1080-
10811077 # Settings per analyzer.
10821078 settings :
10831079 # Analyzer name, run `go tool vet help` to see all analyzers.
Original file line number Diff line number Diff line change @@ -155,6 +155,8 @@ issues:
155155 - path : pkg/commands/run.go
156156 linters : [staticcheck]
157157 text : " SA1019: c.cfg.Run.ShowStats is deprecated: use Output.ShowStats instead."
158+ - path : pkg/golinters/govet.go
159+ text : " SA1019: settings.CheckShadowing is deprecated: the linter should be enabled inside `Enable`."
158160
159161 - path : pkg/golinters/gofumpt.go
160162 linters : [staticcheck]
Original file line number Diff line number Diff line change 16611661 "type" : " object" ,
16621662 "additionalProperties" : false ,
16631663 "properties" : {
1664- "check-shadowing" : {
1665- "description" : " Report shadowed variables." ,
1666- "type" : " boolean" ,
1667- "default" : true
1668- },
16691664 "settings" : {
16701665 "description" : " Settings per analyzer. Map of analyzer name to specific settings.\n Run `go tool vet help` to find out more." ,
16711666 "type" : " object" ,
Original file line number Diff line number Diff line change @@ -598,14 +598,16 @@ type GosmopolitanSettings struct {
598598}
599599
600600type GovetSettings struct {
601- Go string `mapstructure:"-"`
602- CheckShadowing bool `mapstructure:"check-shadowing"`
603- Settings map [string ]map [string ]any
601+ Go string `mapstructure:"-"`
602+ Settings map [string ]map [string ]any
604603
605604 Enable []string
606605 Disable []string
607606 EnableAll bool `mapstructure:"enable-all"`
608607 DisableAll bool `mapstructure:"disable-all"`
608+
609+ // Deprecated: the linter should be enabled inside `Enable`.
610+ CheckShadowing bool `mapstructure:"check-shadowing"`
609611}
610612
611613func (cfg * GovetSettings ) Validate () error {
Original file line number Diff line number Diff line change @@ -322,6 +322,13 @@ func (l *Loader) handleDeprecation() error {
322322 l .cfg .Output .Formats = f
323323 }
324324
325+ // Deprecated since v1.57.0,
326+ // but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
327+ if l .cfg .LintersSettings .Govet .CheckShadowing {
328+ l .warn ("The configuration option `govet.check-shadowing` is deprecated. " +
329+ "Please enable `shadow` instead, if you are not using `enable-all`." )
330+ }
331+
325332 return nil
326333}
327334
You can’t perform that action at this time.
0 commit comments