Skip to content

Commit

Permalink
build(deps): bump github.com/jgautheron/goconst from 1.6.0 to 1.7.0 (g…
Browse files Browse the repository at this point in the history
…olangci#4200)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
2 people authored and Antonboom committed Mar 3, 2024
1 parent e15a82f commit a570e74
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ linters-settings:
# Ignore when constant is not used as function argument.
# Default: true
ignore-calls: false
# Exclude strings matching the given regular expression.
# Default: ""
ignore-strings: 'foo.+'

gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks'.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-version v1.6.0
github.com/hexops/gotextdiff v1.0.3
github.com/jgautheron/goconst v1.6.0
github.com/jgautheron/goconst v1.7.0
github.com/jingyugao/rowserrcheck v1.1.1
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af
github.com/julz/importas v0.1.0
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.

17 changes: 9 additions & 8 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,15 @@ type GocognitSettings struct {
}

type GoConstSettings struct {
IgnoreTests bool `mapstructure:"ignore-tests"`
MatchWithConstants bool `mapstructure:"match-constant"`
MinStringLen int `mapstructure:"min-len"`
MinOccurrencesCount int `mapstructure:"min-occurrences"`
ParseNumbers bool `mapstructure:"numbers"`
NumberMin int `mapstructure:"min"`
NumberMax int `mapstructure:"max"`
IgnoreCalls bool `mapstructure:"ignore-calls"`
IgnoreStrings string `mapstructure:"ignore-strings"`
IgnoreTests bool `mapstructure:"ignore-tests"`
MatchWithConstants bool `mapstructure:"match-constant"`
MinStringLen int `mapstructure:"min-len"`
MinOccurrencesCount int `mapstructure:"min-occurrences"`
ParseNumbers bool `mapstructure:"numbers"`
NumberMin int `mapstructure:"min"`
NumberMax int `mapstructure:"max"`
IgnoreCalls bool `mapstructure:"ignore-calls"`
}

type GoCriticSettings struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/goconst.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewGoconst(settings *config.GoConstSettings) *goanalysis.Linter {

func runGoconst(pass *analysis.Pass, settings *config.GoConstSettings) ([]goanalysis.Issue, error) {
cfg := goconstAPI.Config{
IgnoreStrings: settings.IgnoreStrings,
IgnoreTests: settings.IgnoreTests,
MatchWithConstants: settings.MatchWithConstants,
MinStringLength: settings.MinStringLen,
Expand Down

0 comments on commit a570e74

Please sign in to comment.