Skip to content

build(deps): bump github.com/mgechev/revive from 1.9.0 to 1.10.0 #5837

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

Merged
merged 2 commits into from
May 28, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-test-main-exit
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-test-main-exit
- name: redundant-test-main-exit
severity: warning
disabled: false
Expand Down Expand Up @@ -2629,6 +2629,11 @@ linters:
exclude: [""]
arguments:
- "preserve-scope"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-date
- name: time-date
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-equal
- name: time-equal
severity: warning
Expand Down Expand Up @@ -2669,6 +2674,11 @@ linters:
arguments:
- "fmt.Printf"
- "myFunction"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-format
- name: unnecessary-format
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-stmt
- name: unnecessary-stmt
severity: warning
Expand Down Expand Up @@ -2703,6 +2713,11 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-fmt-print
- name: use-fmt-print
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
severity: warning
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ require (
github.com/maratori/testpackage v1.1.1
github.com/matoous/godox v1.1.0
github.com/mattn/go-colorable v0.1.14
github.com/mgechev/revive v1.9.0
github.com/mgechev/revive v1.10.0
github.com/mitchellh/go-homedir v1.1.0
github.com/moricho/tparallel v0.3.2
github.com/nakabonne/nestif v0.3.1
Expand Down Expand Up @@ -141,6 +141,7 @@ require (
)

require (
codeberg.org/chavacava/garif v0.2.0 // indirect
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -150,7 +151,6 @@ require (
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/dave/dst v0.27.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
Expand Down Expand Up @@ -184,7 +184,6 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
Expand Down
16 changes: 4 additions & 12 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,19 +638,22 @@
"string-of-int",
"struct-tag",
"superfluous-else",
"time-date",
"time-equal",
"time-naming",
"unchecked-type-assertion",
"unconditional-recursion",
"unexported-naming",
"unexported-return",
"unhandled-error",
"unnecessary-format",
"unnecessary-stmt",
"unreachable-code",
"unused-parameter",
"unused-receiver",
"use-any",
"use-errors-new",
"use-fmt-print",
"useless-break",
"var-declaration",
"var-naming",
Expand Down
102 changes: 53 additions & 49 deletions pkg/golinters/revive/revive.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (w *wrapper) toIssue(pass *analysis.Pass, failure *lint.Failure) goanalysis
f := pass.Fset.File(token.Pos(failure.Position.Start.Offset))

// Skip cgo files because the positions are wrong.
if failure.GetFilename() == f.Name() {
if failure.Filename() == f.Name() {
issue.SuggestedFixes = []analysis.SuggestedFix{{
TextEdits: []analysis.TextEdit{{
Pos: f.LineStart(failure.Position.Start.Line),
Expand Down Expand Up @@ -269,7 +269,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.6.0/config/config.go#L16
// Extracted from https://github.com/mgechev/revive/blob/v1.10.0/config/config.go#L16
var defaultRules = []lint.Rule{
&rule.VarDeclarationsRule{},
&rule.PackageCommentsRule{},
Expand Down Expand Up @@ -297,66 +297,70 @@ var defaultRules = []lint.Rule{
}

var allRules = append([]lint.Rule{
&rule.AddConstantRule{},
&rule.ArgumentsLimitRule{},
&rule.CyclomaticRule{},
&rule.FileHeaderRule{},
&rule.AtomicRule{},
&rule.BannedCharsRule{},
&rule.BareReturnRule{},
&rule.BoolLiteralRule{},
&rule.CallToGCRule{},
&rule.CognitiveComplexityRule{},
&rule.CommentsDensityRule{},
&rule.CommentSpacingsRule{},
&rule.ConfusingNamingRule{},
&rule.GetReturnRule{},
&rule.ModifiesParamRule{},
&rule.ConfusingResultsRule{},
&rule.DeepExitRule{},
&rule.AddConstantRule{},
&rule.FlagParamRule{},
&rule.UnnecessaryStmtRule{},
&rule.StructTagRule{},
&rule.ModifiesValRecRule{},
&rule.ConstantLogicalExprRule{},
&rule.BoolLiteralRule{},
&rule.ImportsBlocklistRule{},
&rule.FunctionResultsLimitRule{},
&rule.MaxPublicStructsRule{},
&rule.RangeValInClosureRule{},
&rule.RangeValAddress{},
&rule.WaitGroupByValueRule{},
&rule.AtomicRule{},
&rule.EmptyLinesRule{},
&rule.LineLengthLimitRule{},
&rule.CallToGCRule{},
&rule.CyclomaticRule{},
&rule.DataRaceRule{},
&rule.DeepExitRule{},
&rule.DeferRule{},
&rule.DuplicatedImportsRule{},
&rule.ImportShadowingRule{},
&rule.BareReturnRule{},
&rule.UnusedReceiverRule{},
&rule.UnhandledErrorRule{},
&rule.CognitiveComplexityRule{},
&rule.StringOfIntRule{},
&rule.StringFormatRule{},
&rule.EarlyReturnRule{},
&rule.UnconditionalRecursionRule{},
&rule.IdenticalBranchesRule{},
&rule.DeferRule{},
&rule.UnexportedNamingRule{},
&rule.FunctionLength{},
&rule.NestedStructs{},
&rule.UselessBreak{},
&rule.UncheckedTypeAssertionRule{},
&rule.TimeEqualRule{},
&rule.BannedCharsRule{},
&rule.OptimizeOperandsOrderRule{},
&rule.UseAnyRule{},
&rule.DataRaceRule{},
&rule.CommentSpacingsRule{},
&rule.IfReturnRule{},
&rule.RedundantImportAlias{},
&rule.ImportAliasNamingRule{},
&rule.EmptyLinesRule{},
&rule.EnforceMapStyleRule{},
&rule.EnforceRepeatedArgTypeStyleRule{},
&rule.EnforceSliceStyleRule{},
&rule.MaxControlNestingRule{},
&rule.CommentsDensityRule{},
&rule.FileHeaderRule{},
&rule.FileLengthLimitRule{},
&rule.FilenameFormatRule{},
&rule.FlagParamRule{},
&rule.FunctionLength{},
&rule.FunctionResultsLimitRule{},
&rule.GetReturnRule{},
&rule.IdenticalBranchesRule{},
&rule.IfReturnRule{},
&rule.ImportAliasNamingRule{},
&rule.ImportsBlocklistRule{},
&rule.ImportShadowingRule{},
&rule.LineLengthLimitRule{},
&rule.MaxControlNestingRule{},
&rule.MaxPublicStructsRule{},
&rule.ModifiesParamRule{},
&rule.ModifiesValRecRule{},
&rule.NestedStructs{},
&rule.OptimizeOperandsOrderRule{},
&rule.RangeValAddress{},
&rule.RangeValInClosureRule{},
&rule.RedundantBuildTagRule{},
&rule.RedundantImportAlias{},
&rule.RedundantTestMainExitRule{},
&rule.StringFormatRule{},
&rule.StringOfIntRule{},
&rule.StructTagRule{},
&rule.TimeDateRule{},
&rule.TimeEqualRule{},
&rule.UncheckedTypeAssertionRule{},
&rule.UnconditionalRecursionRule{},
&rule.UnexportedNamingRule{},
&rule.UnhandledErrorRule{},
&rule.UnnecessaryFormatRule{},
&rule.UnnecessaryStmtRule{},
&rule.UnusedReceiverRule{},
&rule.UseAnyRule{},
&rule.UseErrorsNewRule{},
&rule.UseFmtPrintRule{},
&rule.UselessBreak{},
&rule.WaitGroupByValueRule{},
}, defaultRules...)

const defaultConfidence = 0.8
Expand Down
Loading