Skip to content

Commit

Permalink
build(deps): bump github.com/mgechev/revive from 1.3.6 to 1.3.7 (#4355)
Browse files Browse the repository at this point in the history
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez authored Feb 7, 2024
1 parent 3d3a0bc commit ca7b7a4
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 15 deletions.
9 changes: 7 additions & 2 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1734,8 +1734,8 @@ linters-settings:
disabled: false
arguments:
- "^[a-z][a-z0-9]{0,}$"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blacklist
- name: imports-blacklist
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blocklist
- name: imports-blocklist
severity: warning
disabled: false
arguments:
Expand All @@ -1750,6 +1750,11 @@ linters-settings:
severity: warning
disabled: false
arguments: [ 80 ]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-control-nesting
- name: max-control-nesting
severity: warning
disabled: false
arguments: [ 3 ]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
- name: max-public-structs
severity: warning
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26
github.com/mattn/go-colorable v0.1.13
github.com/mbilski/exhaustivestruct v1.2.0
github.com/mgechev/revive v1.3.6
github.com/mgechev/revive v1.3.7
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-ps v1.0.0
github.com/moricho/tparallel v0.3.1
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: 1 addition & 1 deletion pkg/commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (e *Executor) initVersion() {
Short: "Version",
Args: cobra.NoArgs,
ValidArgsFunction: cobra.NoFileCompletions,
RunE: func(cmd *cobra.Command, _ []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
if e.cfg.Version.Debug {
info, ok := debug.ReadBuildInfo()
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/gochecksumtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewGoCheckSumType() *goanalysis.Linter {
`Run exhaustiveness checks on Go "sum types"`,
[]*analysis.Analyzer{analyzer},
nil,
).WithIssuesReporter(func(ctx *linter.Context) []goanalysis.Issue {
).WithIssuesReporter(func(_ *linter.Context) []goanalysis.Issue {
return resIssues
}).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/golinters/revive.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func safeTomlSlice(r []any) []any {
}

// This element is not exported by revive, so we need copy the code.
// Extracted from https://github.com/mgechev/revive/blob/v1.3.5/config/config.go#L15
// Extracted from https://github.com/mgechev/revive/blob/v1.3.7/config/config.go#L15
var defaultRules = []lint.Rule{
&rule.VarDeclarationsRule{},
&rule.PackageCommentsRule{},
Expand Down Expand Up @@ -290,7 +290,7 @@ var allRules = append([]lint.Rule{
&rule.ModifiesValRecRule{},
&rule.ConstantLogicalExprRule{},
&rule.BoolLiteralRule{},
&rule.ImportsBlacklistRule{},
&rule.ImportsBlocklistRule{},
&rule.FunctionResultsLimitRule{},
&rule.MaxPublicStructsRule{},
&rule.RangeValInClosureRule{},
Expand Down Expand Up @@ -329,6 +329,7 @@ var allRules = append([]lint.Rule{
&rule.EnforceMapStyleRule{},
&rule.EnforceRepeatedArgTypeStyleRule{},
&rule.EnforceSliceStyleRule{},
&rule.MaxControlNestingRule{},
}, defaultRules...)

const defaultConfidence = 0.8
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/stylecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewStylecheck(settings *config.StaticCheckSettings) *goanalysis.Linter {
// `scconfig.Analyzer` is a singleton, then it's not possible to have more than one instance for all staticcheck "sub-linters".
// When we will merge the 4 "sub-linters", the problem will disappear: https://github.com/golangci/golangci-lint/issues/357
// Currently only stylecheck analyzer has a configuration in staticcheck.
scconfig.Analyzer.Run = func(pass *analysis.Pass) (any, error) {
scconfig.Analyzer.Run = func(_ *analysis.Pass) (any, error) {
return cfg, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/unused.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewUnused(settings *config.UnusedSettings, scSettings *config.StaticCheckSe
"Checks Go code for unused constants, variables, functions and types",
[]*analysis.Analyzer{analyzer},
nil,
).WithIssuesReporter(func(lintCtx *linter.Context) []goanalysis.Issue {
).WithIssuesReporter(func(_ *linter.Context) []goanalysis.Issue {
return resIssues
}).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/varcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewVarcheck(settings *config.VarCheckSettings) *goanalysis.Linter {
"Finds unused global variables and constants",
[]*analysis.Analyzer{analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
).WithContextSetter(func(_ *linter.Context) {
analyzer.Run = func(pass *analysis.Pass) (any, error) {
issues := runVarCheck(pass, settings)

Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/whitespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewWhitespace(settings *config.WhitespaceSettings) *goanalysis.Linter {
a.Doc,
[]*analysis.Analyzer{a},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
).WithContextSetter(func(_ *linter.Context) {
a.Run = func(pass *analysis.Pass) (any, error) {
issues, err := runWhitespace(pass, wsSettings)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lint/linter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (lc *Config) WithNoopFallback(cfg *config.Config) *Config {
lc.Linter = &Noop{
name: lc.Linter.Name(),
desc: lc.Linter.Desc(),
run: func(pass *analysis.Pass) (any, error) {
run: func(_ *analysis.Pass) (any, error) {
return nil, nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion test/testshared/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func parseComments(sourcePath string, fileData []byte) (map[key][]expectation, e
func parseExpectations(text string) (lineDelta int, expects []expectation, err error) {
var scanErr string
sc := new(scanner.Scanner).Init(strings.NewReader(text))
sc.Error = func(s *scanner.Scanner, msg string) {
sc.Error = func(_ *scanner.Scanner, msg string) {
scanErr = msg // e.g. bad string escape
}
sc.Mode = scanner.ScanIdents | scanner.ScanStrings | scanner.ScanRawStrings | scanner.ScanInts
Expand Down

0 comments on commit ca7b7a4

Please sign in to comment.