mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
errcheck: allow exclude config without extra file (#2110)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
f285d2c570
commit
b3f9763246
6 changed files with 47 additions and 4 deletions
|
@ -161,10 +161,13 @@ type DuplSettings struct {
|
|||
}
|
||||
|
||||
type ErrcheckSettings struct {
|
||||
CheckTypeAssertions bool `mapstructure:"check-type-assertions"`
|
||||
CheckAssignToBlank bool `mapstructure:"check-blank"`
|
||||
Ignore string `mapstructure:"ignore"`
|
||||
Exclude string `mapstructure:"exclude"`
|
||||
CheckTypeAssertions bool `mapstructure:"check-type-assertions"`
|
||||
CheckAssignToBlank bool `mapstructure:"check-blank"`
|
||||
Ignore string `mapstructure:"ignore"`
|
||||
ExcludeFunctions []string `mapstructure:"exclude-functions"`
|
||||
|
||||
// Deprecated: use ExcludeFunctions instead
|
||||
Exclude string `mapstructure:"exclude"`
|
||||
}
|
||||
|
||||
type ErrorLintSettings struct {
|
||||
|
|
|
@ -152,6 +152,8 @@ func getChecker(errCfg *config.ErrcheckSettings) (*errcheck.Checker, error) {
|
|||
checker.Exclusions.Symbols = append(checker.Exclusions.Symbols, exclude...)
|
||||
}
|
||||
|
||||
checker.Exclusions.Symbols = append(checker.Exclusions.Symbols, errCfg.ExcludeFunctions...)
|
||||
|
||||
return &checker, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue