Skip to content

Commit 7fb3021

Browse files
build(deps): bump github.com/nishanths/exhaustive from 0.8.3 to 0.9.2 (#3381)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 0eb5e26 commit 7fb3021

File tree

7 files changed

+11
-5
lines changed

7 files changed

+11
-5
lines changed

.golangci.reference.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ linters-settings:
318318
# switch statements to satisfy exhaustiveness.
319319
# Default: ""
320320
ignore-enum-members: "Example.+"
321+
# Enum types matching the supplied regex do not have to be listed in
322+
# switch statements to satisfy exhaustiveness.
323+
# Default: ""
324+
ignore-enum-types: "Example.+"
321325
# Consider enums only in package scopes, not in inner scopes.
322326
# Default: false
323327
package-scope-only: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ require (
7070
github.com/mitchellh/go-ps v1.0.0
7171
github.com/moricho/tparallel v0.2.1
7272
github.com/nakabonne/nestif v0.3.1
73-
github.com/nishanths/exhaustive v0.8.3
73+
github.com/nishanths/exhaustive v0.9.2
7474
github.com/nishanths/predeclared v0.2.2
7575
github.com/pkg/errors v0.9.1
7676
github.com/polyfloyd/go-errorlint v1.0.6

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ type ExhaustiveSettings struct {
289289
CheckGenerated bool `mapstructure:"check-generated"`
290290
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
291291
IgnoreEnumMembers string `mapstructure:"ignore-enum-members"`
292+
IgnoreEnumTypes string `mapstructure:"ignore-enum-types"`
292293
PackageScopeOnly bool `mapstructure:"package-scope-only"`
293294
ExplicitExhaustiveMap bool `mapstructure:"explicit-exhaustive-map"`
294295
ExplicitExhaustiveSwitch bool `mapstructure:"explicit-exhaustive-switch"`

pkg/golinters/exhaustive.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter {
1919
exhaustive.CheckGeneratedFlag: settings.CheckGenerated,
2020
exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive,
2121
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
22+
exhaustive.IgnoreEnumTypesFlag: settings.IgnoreEnumTypes,
2223
exhaustive.PackageScopeOnlyFlag: settings.PackageScopeOnly,
2324
exhaustive.ExplicitExhaustiveMapFlag: settings.ExplicitExhaustiveMap,
2425
exhaustive.ExplicitExhaustiveSwitchFlag: settings.ExplicitExhaustiveSwitch,

test/testdata/exhaustive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111
)
1212

1313
func processDirection(d Direction) {
14-
switch d { // want "missing cases in switch of type Direction: East, West"
14+
switch d { // want "missing cases in switch of type testdata.Direction: testdata.East, testdata.West"
1515
case North, South:
1616
}
1717
}

test/testdata/exhaustive_ignore_enum_members.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
// using the ignore-enum-members setting.
1616

1717
func processDirectionIgnoreEnumMembers(d Direction) {
18-
switch d { // want "missing cases in switch of type Direction: East"
18+
switch d { // want "missing cases in switch of type testdata.Direction: testdata.East"
1919
case North, South:
2020
}
2121
}

0 commit comments

Comments
 (0)