dev: deprecate errcheck.ignore option (#4709)
This commit is contained in:
parent
e89b55c015
commit
565c81fa8f
@ -167,6 +167,9 @@ issues:
|
|||||||
- path: pkg/golinters/errcheck/errcheck.go
|
- path: pkg/golinters/errcheck/errcheck.go
|
||||||
linters: [staticcheck]
|
linters: [staticcheck]
|
||||||
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
|
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
|
||||||
|
- path: pkg/golinters/errcheck/errcheck.go
|
||||||
|
linters: [staticcheck]
|
||||||
|
text: "SA1019: errCfg.Ignore is deprecated: use ExcludeFunctions instead"
|
||||||
- path: pkg/golinters/govet/govet.go
|
- path: pkg/golinters/govet/govet.go
|
||||||
linters: [staticcheck]
|
linters: [staticcheck]
|
||||||
text: "SA1019: cfg.CheckShadowing is deprecated: the linter should be enabled inside Enable."
|
text: "SA1019: cfg.CheckShadowing is deprecated: the linter should be enabled inside Enable."
|
||||||
|
@ -371,11 +371,13 @@ type ErrcheckSettings struct {
|
|||||||
DisableDefaultExclusions bool `mapstructure:"disable-default-exclusions"`
|
DisableDefaultExclusions bool `mapstructure:"disable-default-exclusions"`
|
||||||
CheckTypeAssertions bool `mapstructure:"check-type-assertions"`
|
CheckTypeAssertions bool `mapstructure:"check-type-assertions"`
|
||||||
CheckAssignToBlank bool `mapstructure:"check-blank"`
|
CheckAssignToBlank bool `mapstructure:"check-blank"`
|
||||||
Ignore string `mapstructure:"ignore"`
|
|
||||||
ExcludeFunctions []string `mapstructure:"exclude-functions"`
|
ExcludeFunctions []string `mapstructure:"exclude-functions"`
|
||||||
|
|
||||||
// Deprecated: use ExcludeFunctions instead
|
// Deprecated: use ExcludeFunctions instead
|
||||||
Exclude string `mapstructure:"exclude"`
|
Exclude string `mapstructure:"exclude"`
|
||||||
|
|
||||||
|
// Deprecated: use ExcludeFunctions instead
|
||||||
|
Ignore string `mapstructure:"ignore"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ErrChkJSONSettings struct {
|
type ErrChkJSONSettings struct {
|
||||||
|
@ -355,6 +355,7 @@ func (l *Loader) handleDeprecation() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:gocyclo // the complexity cannot be reduced.
|
||||||
func (l *Loader) handleLinterOptionDeprecations() {
|
func (l *Loader) handleLinterOptionDeprecations() {
|
||||||
// Deprecated since v1.57.0,
|
// Deprecated since v1.57.0,
|
||||||
// but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
|
// but it was unofficially deprecated since v1.19 (2019) (https://github.com/golangci/golangci-lint/pull/697).
|
||||||
@ -373,6 +374,12 @@ func (l *Loader) handleLinterOptionDeprecations() {
|
|||||||
l.log.Warnf("The configuration option `linters.errcheck.exclude` is deprecated, please use `linters.errcheck.exclude-functions`.")
|
l.log.Warnf("The configuration option `linters.errcheck.exclude` is deprecated, please use `linters.errcheck.exclude-functions`.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated since v1.59.0,
|
||||||
|
// but it was unofficially deprecated since v1.13 (2018) (https://github.com/golangci/golangci-lint/pull/332).
|
||||||
|
if l.cfg.LintersSettings.Errcheck.Ignore != "" {
|
||||||
|
l.log.Warnf("The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`.")
|
||||||
|
}
|
||||||
|
|
||||||
// Deprecated since v1.44.0.
|
// Deprecated since v1.44.0.
|
||||||
if l.cfg.LintersSettings.Gci.LocalPrefixes != "" {
|
if l.cfg.LintersSettings.Gci.LocalPrefixes != "" {
|
||||||
l.log.Warnf("The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`.")
|
l.log.Warnf("The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user