Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump github.com/nishanths/exhaustive from 0.8.1 to 0.8.3 #3207

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.reference.yml
Expand Up @@ -307,6 +307,12 @@ linters-settings:
# Consider enums only in package scopes, not in inner scopes.
# Default: false
package-scope-only: true
# only run exhaustive check on switches with "//exhaustive:enforce" comment
# Default: false
explicit-exhaustive-switch: true
# only run exhaustive check on map literals with "//exhaustive:enforce" comment.
# Default: false
explicit-exhaustive-map: true

exhaustivestruct:
# Struct Patterns is list of expressions to match struct packages and names.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -69,7 +69,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.1
github.com/nishanths/exhaustive v0.8.3
github.com/nishanths/predeclared v0.2.2
github.com/pkg/errors v0.9.1
github.com/polyfloyd/go-errorlint v1.0.2
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.

2 changes: 2 additions & 0 deletions pkg/config/linters_settings.go
Expand Up @@ -278,6 +278,8 @@ type ExhaustiveSettings struct {
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
IgnoreEnumMembers string `mapstructure:"ignore-enum-members"`
PackageScopeOnly bool `mapstructure:"package-scope-only"`
ExplicitExhaustiveMap bool `mapstructure:"explicit-exhaustive-map"`
ExplicitExhaustiveSwitch bool `mapstructure:"explicit-exhaustive-switch"`
}

type ExhaustiveStructSettings struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/golinters/exhaustive.go
Expand Up @@ -17,8 +17,9 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter {
a.Name: {
exhaustive.CheckGeneratedFlag: settings.CheckGenerated,
exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive,
exhaustive.ExplicitExhaustiveMapFlag: settings.ExplicitExhaustiveMap,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a new config - exhaustive.CheckFlag

exhaustive.ExplicitExhaustiveSwitchFlag: settings.PackageScopeOnly,
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
exhaustive.PackageScopeOnlyFlag: settings.PackageScopeOnly,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you removed this config?

},
}
}
Expand Down