File tree Expand file tree Collapse file tree 6 files changed +35
-5
lines changed Expand file tree Collapse file tree 6 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -557,6 +557,7 @@ linters-settings:
557557 gofumpt :
558558 # Select the Go version to target.
559559 # Default: "1.15"
560+ # Deprecated: use the global `run.go` instead.
560561 lang-version : " 1.17"
561562
562563 # Module path which contains the source code being formatted.
@@ -699,6 +700,7 @@ linters-settings:
699700 gosimple :
700701 # Select the Go version to target.
701702 # Default: 1.13
703+ # Deprecated: use the global `run.go` instead.
702704 go : " 1.15"
703705 # https://staticcheck.io/docs/options#checks
704706 # Default: ["*"]
@@ -1568,6 +1570,7 @@ linters-settings:
15681570 staticcheck :
15691571 # Select the Go version to target.
15701572 # Default: "1.13"
1573+ # Deprecated: use the global `run.go` instead.
15711574 go : " 1.15"
15721575 # https://staticcheck.io/docs/options#checks
15731576 # Default: ["*"]
@@ -1576,6 +1579,7 @@ linters-settings:
15761579 stylecheck :
15771580 # Select the Go version to target.
15781581 # Default: 1.13
1582+ # Deprecated: use the global `run.go` instead.
15791583 go : " 1.15"
15801584 # https://staticcheck.io/docs/options#checks
15811585 # Default: ["*"]
Original file line number Diff line number Diff line change @@ -134,6 +134,14 @@ issues:
134134 - path : pkg/commands/run.go
135135 text : " SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used."
136136
137+ - path : pkg/golinters/gofumpt.go
138+ text : " SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
139+ - path : pkg/golinters/staticcheck_common.go
140+ text : " SA1019: settings.GoVersion is deprecated: use the global `run.go` instead."
141+ - path : pkg/lint/lintersdb/manager.go
142+ text : " SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead."
143+
144+
137145run :
138146 timeout : 5m
139147 go : ' 1.17' # TODO(ldez): we force to use an old version of Go for the CI and the tests.
Original file line number Diff line number Diff line change @@ -318,9 +318,11 @@ type GoFmtSettings struct {
318318}
319319
320320type GofumptSettings struct {
321+ ModulePath string `mapstructure:"module-path"`
322+ ExtraRules bool `mapstructure:"extra-rules"`
323+
324+ // Deprecated: use the global `run.go` instead.
321325 LangVersion string `mapstructure:"lang-version"`
322- ModulePath string `mapstructure:"module-path"`
323- ExtraRules bool `mapstructure:"extra-rules"`
324326}
325327
326328type GoHeaderSettings struct {
@@ -527,6 +529,7 @@ type RowsErrCheckSettings struct {
527529}
528530
529531type StaticCheckSettings struct {
532+ // Deprecated: use the global `run.go` instead.
530533 GoVersion string `mapstructure:"go"`
531534
532535 Checks []string `mapstructure:"checks"`
Original file line number Diff line number Diff line change 99
1010func NewStaticcheck (settings * config.StaticCheckSettings ) * goanalysis.Linter {
1111 cfg := staticCheckConfig (settings )
12-
1312 analyzers := setupStaticCheckAnalyzers (staticcheck .Analyzers , getGoVersion (settings ), cfg .Checks )
1413
1514 return goanalysis .NewLinter (
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ func getGoVersion(settings *config.StaticCheckSettings) string {
2424 return goVersion
2525 }
2626
27- // TODO: uses "1.13" for backward compatibility, but in the future (v2) must be set by using build.Default.ReleaseTags like staticcheck.
28- return "1.13"
27+ return "1.17"
2928}
3029
3130func setupStaticCheckAnalyzers (src []* lint.Analyzer , goVersion string , checks []string ) []* analysis.Analyzer {
Original file line number Diff line number Diff line change @@ -240,6 +240,23 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
240240 if govetCfg != nil {
241241 govetCfg .Go = m .cfg .Run .Go
242242 }
243+
244+ if gofumptCfg != nil && gofumptCfg .LangVersion == "" {
245+ gofumptCfg .LangVersion = m .cfg .Run .Go
246+ }
247+
248+ if staticcheckCfg != nil && staticcheckCfg .GoVersion == "" {
249+ staticcheckCfg .GoVersion = m .cfg .Run .Go
250+ }
251+ if gosimpleCfg != nil && gosimpleCfg .GoVersion == "" {
252+ gosimpleCfg .GoVersion = m .cfg .Run .Go
253+ }
254+ if stylecheckCfg != nil && stylecheckCfg .GoVersion != "" {
255+ stylecheckCfg .GoVersion = m .cfg .Run .Go
256+ }
257+ if unusedCfg != nil && unusedCfg .GoVersion == "" {
258+ unusedCfg .GoVersion = m .cfg .Run .Go
259+ }
243260 }
244261
245262 const megacheckName = "megacheck"
You can’t perform that action at this time.
0 commit comments