build(deps): bump github.com/mgechev/revive from 1.3.6 to 1.3.7 (#4355)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
3d3a0bc103
commit
ca7b7a42d2
@ -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:
|
||||
@ -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
|
||||
|
2
go.mod
2
go.mod
@ -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
|
||||
|
4
go.sum
generated
4
go.sum
generated
@ -376,8 +376,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo=
|
||||
github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc=
|
||||
github.com/mgechev/revive v1.3.6 h1:ZNKZiHb/LciAqzwa/9HnwI8S/OJutYhMvaqgMT1Ylgo=
|
||||
github.com/mgechev/revive v1.3.6/go.mod h1:75Je+5jKBgdgADNzGhsq7H5J6CmyXSzEk9eLOU4i8Pg=
|
||||
github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE=
|
||||
github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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{},
|
||||
@ -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{},
|
||||
@ -329,6 +329,7 @@ var allRules = append([]lint.Rule{
|
||||
&rule.EnforceMapStyleRule{},
|
||||
&rule.EnforceRepeatedArgTypeStyleRule{},
|
||||
&rule.EnforceSliceStyleRule{},
|
||||
&rule.MaxControlNestingRule{},
|
||||
}, defaultRules...)
|
||||
|
||||
const defaultConfidence = 0.8
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
},
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user