Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ linters-settings:
# See the https://github.com/polyfloyd/go-errorlint for caveats.
# Default: true
errorf: false
# Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true)
# Default: true
errorf-multi: false
# Check for plain type assertions and type switches.
# Default: true
asserts: false
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
github.com/nishanths/exhaustive v0.9.5
github.com/nishanths/predeclared v0.2.2
github.com/nunnatsa/ginkgolinter v0.8.1
github.com/polyfloyd/go-errorlint v1.1.0
github.com/polyfloyd/go-errorlint v1.2.0
github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/ryancurrah/gomodguard v1.3.0
github.com/ryanrolds/sqlclosecheck v0.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ var defaultLintersSettings = LintersSettings{
MaxBlankIdentifiers: 2,
},
ErrorLint: ErrorLintSettings{
Errorf: true,
Asserts: true,
Comparison: true,
Errorf: true,
ErrorfMulti: true,
Asserts: true,
Comparison: true,
},
Exhaustive: ExhaustiveSettings{
Check: []string{"switch"},
Expand Down Expand Up @@ -280,9 +281,10 @@ type ErrChkJSONSettings struct {
}

type ErrorLintSettings struct {
Errorf bool `mapstructure:"errorf"`
Asserts bool `mapstructure:"asserts"`
Comparison bool `mapstructure:"comparison"`
Errorf bool `mapstructure:"errorf"`
ErrorfMulti bool `mapstructure:"errorf-multi"`
Asserts bool `mapstructure:"asserts"`
Comparison bool `mapstructure:"comparison"`
}

type ExhaustiveSettings struct {
Expand Down
7 changes: 4 additions & 3 deletions pkg/golinters/errorlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func NewErrorLint(cfg *config.ErrorLintSettings) *goanalysis.Linter {

if cfg != nil {
cfgMap[a.Name] = map[string]interface{}{
"errorf": cfg.Errorf,
"asserts": cfg.Asserts,
"comparison": cfg.Comparison,
"errorf": cfg.Errorf,
"errorf-multi": cfg.ErrorfMulti,
"asserts": cfg.Asserts,
"comparison": cfg.Comparison,
}
}

Expand Down