Skip to content

Commit 16bc026

Browse files
dependabot[bot]ldez
authored andcommitted
build(deps): bump github.com/nishanths/exhaustive from 0.3.6 to 0.6.0 (golangci#2353)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent d3c7b4a commit 16bc026

9 files changed

+13
-57
lines changed

.golangci.example.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ linters-settings:
154154
# enum members matching the supplied regex do not have to be listed in
155155
# switch statements to satisfy exhaustiveness
156156
ignore-enum-members: ""
157-
# strategy to use when checking exhaustiveness of switch statements; one of:
158-
# "name", "value"; see documentation for details:
159-
# https://pkg.go.dev/github.com/nishanths/exhaustive#section-documentation
160-
checking-strategy: "value"
157+
# consider enums only in package scopes, not in inner scopes
158+
package-scope-only: false
161159

162160
exhaustivestruct:
163161
# Struct Patterns is list of expressions to match struct packages and names

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ require (
5959
github.com/mitchellh/go-ps v1.0.0
6060
github.com/moricho/tparallel v0.2.1
6161
github.com/nakabonne/nestif v0.3.1
62-
github.com/nishanths/exhaustive v0.3.6
62+
github.com/nishanths/exhaustive v0.6.0
6363
github.com/nishanths/predeclared v0.2.1
6464
github.com/pkg/errors v0.9.1
6565
github.com/polyfloyd/go-errorlint v0.0.0-20210722154253-910bb7978349

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ type ErrorLintSettings struct {
199199
type ExhaustiveSettings struct {
200200
CheckGenerated bool `mapstructure:"check-generated"`
201201
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
202-
IgnorePattern string `mapstructure:"ignore-pattern"` // Deprecated: this setting has no effect; see IgnoreEnumMembers instead.
203202
IgnoreEnumMembers string `mapstructure:"ignore-enum-members"`
204-
CheckingStrategy string `mapstructure:"checking-strategy"`
203+
PackageScopeOnly bool `mapstructure:"package-scope-only"`
204+
205+
IgnorePattern string `mapstructure:"ignore-pattern"` // Deprecated: this setting has no effect; see IgnoreEnumMembers instead.
206+
CheckingStrategy string `mapstructure:"checking-strategy"` // Deprecated.
205207
}
206208

207209
type ExhaustiveStructSettings struct {

pkg/golinters/exhaustive.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter {
1717
a.Name: {
1818
exhaustive.CheckGeneratedFlag: settings.CheckGenerated,
1919
exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive,
20-
exhaustive.IgnorePatternFlag: settings.IgnorePattern,
2120
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
22-
exhaustive.CheckingStrategyFlag: settings.CheckingStrategy,
21+
exhaustive.PackageScopeOnly: settings.PackageScopeOnly,
22+
23+
exhaustive.IgnorePatternFlag: settings.IgnorePattern,
24+
exhaustive.CheckingStrategyFlag: settings.CheckingStrategy,
2325
},
2426
}
2527
}

test/testdata/configs/exhaustive_checking_strategy_name.yml

-3
This file was deleted.

test/testdata/configs/exhaustive_checking_strategy_value.yml

-3
This file was deleted.

test/testdata/exhaustive_checking_strategy_name.go

-18
This file was deleted.

test/testdata/exhaustive_checking_strategy_value.go

-22
This file was deleted.

0 commit comments

Comments
 (0)