File tree 5 files changed +14
-12
lines changed
5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -1074,10 +1074,6 @@ linters-settings:
1074
1074
- Katakana
1075
1075
1076
1076
govet :
1077
- # Report about shadowed variables.
1078
- # Default: false
1079
- check-shadowing : true
1080
-
1081
1077
# Settings per analyzer.
1082
1078
settings :
1083
1079
# 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:
155
155
- path : pkg/commands/run.go
156
156
linters : [staticcheck]
157
157
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`."
158
160
159
161
- path : pkg/golinters/gofumpt.go
160
162
linters : [staticcheck]
Original file line number Diff line number Diff line change 1661
1661
"type" : " object" ,
1662
1662
"additionalProperties" : false ,
1663
1663
"properties" : {
1664
- "check-shadowing" : {
1665
- "description" : " Report shadowed variables." ,
1666
- "type" : " boolean" ,
1667
- "default" : true
1668
- },
1669
1664
"settings" : {
1670
1665
"description" : " Settings per analyzer. Map of analyzer name to specific settings.\n Run `go tool vet help` to find out more." ,
1671
1666
"type" : " object" ,
Original file line number Diff line number Diff line change @@ -598,14 +598,16 @@ type GosmopolitanSettings struct {
598
598
}
599
599
600
600
type 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
604
603
605
604
Enable []string
606
605
Disable []string
607
606
EnableAll bool `mapstructure:"enable-all"`
608
607
DisableAll bool `mapstructure:"disable-all"`
608
+
609
+ // Deprecated: the linter should be enabled inside `Enable`.
610
+ CheckShadowing bool `mapstructure:"check-shadowing"`
609
611
}
610
612
611
613
func (cfg * GovetSettings ) Validate () error {
Original file line number Diff line number Diff line change @@ -322,6 +322,13 @@ func (l *Loader) handleDeprecation() error {
322
322
l .cfg .Output .Formats = f
323
323
}
324
324
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
+
325
332
return nil
326
333
}
327
334
You can’t perform that action at this time.
0 commit comments