Skip to content

Commit

Permalink
build(deps): bump github.com/nishanths/exhaustive from 0.8.3 to 0.9.2 (
Browse files Browse the repository at this point in the history
…#3381)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez authored Nov 27, 2022
1 parent 0eb5e26 commit 7fb3021
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ linters-settings:
# switch statements to satisfy exhaustiveness.
# Default: ""
ignore-enum-members: "Example.+"
# Enum types matching the supplied regex do not have to be listed in
# switch statements to satisfy exhaustiveness.
# Default: ""
ignore-enum-types: "Example.+"
# Consider enums only in package scopes, not in inner scopes.
# Default: false
package-scope-only: true
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require (
github.com/mitchellh/go-ps v1.0.0
github.com/moricho/tparallel v0.2.1
github.com/nakabonne/nestif v0.3.1
github.com/nishanths/exhaustive v0.8.3
github.com/nishanths/exhaustive v0.9.2
github.com/nishanths/predeclared v0.2.2
github.com/pkg/errors v0.9.1
github.com/polyfloyd/go-errorlint v1.0.6
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.

1 change: 1 addition & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ type ExhaustiveSettings struct {
CheckGenerated bool `mapstructure:"check-generated"`
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
IgnoreEnumMembers string `mapstructure:"ignore-enum-members"`
IgnoreEnumTypes string `mapstructure:"ignore-enum-types"`
PackageScopeOnly bool `mapstructure:"package-scope-only"`
ExplicitExhaustiveMap bool `mapstructure:"explicit-exhaustive-map"`
ExplicitExhaustiveSwitch bool `mapstructure:"explicit-exhaustive-switch"`
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/exhaustive.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter {
exhaustive.CheckGeneratedFlag: settings.CheckGenerated,
exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive,
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
exhaustive.IgnoreEnumTypesFlag: settings.IgnoreEnumTypes,
exhaustive.PackageScopeOnlyFlag: settings.PackageScopeOnly,
exhaustive.ExplicitExhaustiveMapFlag: settings.ExplicitExhaustiveMap,
exhaustive.ExplicitExhaustiveSwitchFlag: settings.ExplicitExhaustiveSwitch,
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/exhaustive.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
)

func processDirection(d Direction) {
switch d { // want "missing cases in switch of type Direction: East, West"
switch d { // want "missing cases in switch of type testdata.Direction: testdata.East, testdata.West"
case North, South:
}
}
2 changes: 1 addition & 1 deletion test/testdata/exhaustive_ignore_enum_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
// using the ignore-enum-members setting.

func processDirectionIgnoreEnumMembers(d Direction) {
switch d { // want "missing cases in switch of type Direction: East"
switch d { // want "missing cases in switch of type testdata.Direction: testdata.East"
case North, South:
}
}

0 comments on commit 7fb3021

Please sign in to comment.