Skip to content

Commit

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

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
2 people authored and SeigeC committed Apr 4, 2023
1 parent 1bf8c70 commit 85f9073
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
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.3
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,
exhaustive.ExplicitExhaustiveSwitchFlag: settings.PackageScopeOnly,
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
exhaustive.PackageScopeOnlyFlag: settings.PackageScopeOnly,
},
}
}
Expand Down

0 comments on commit 85f9073

Please sign in to comment.