Skip to content

Commit e438834

Browse files
build(deps): bump github.com/mgechev/revive from 1.11.0 to 1.12.0 (#6035)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 068a2b5 commit e438834

File tree

5 files changed

+65
-7
lines changed

5 files changed

+65
-7
lines changed

.golangci.next.reference.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,26 @@ linters:
25182518
severity: warning
25192519
disabled: false
25202520
exclude: [""]
2521+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-branches
2522+
- name: identical-ifelseif-branches
2523+
severity: warning
2524+
disabled: false
2525+
exclude: [""]
2526+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-conditions
2527+
- name: identical-ifelseif-conditions
2528+
severity: warning
2529+
disabled: false
2530+
exclude: [""]
2531+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-branches
2532+
- name: identical-switch-branches
2533+
severity: warning
2534+
disabled: false
2535+
exclude: [""]
2536+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-conditions
2537+
- name: identical-switch-conditions
2538+
severity: warning
2539+
disabled: false
2540+
exclude: [""]
25212541
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#if-return
25222542
- name: if-return
25232543
severity: warning
@@ -2601,6 +2621,13 @@ linters:
26012621
severity: warning
26022622
disabled: false
26032623
exclude: [""]
2624+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-directory-mismatch
2625+
- name: package-directory-mismatch
2626+
severity: warning
2627+
disabled: false
2628+
exclude: [""]
2629+
arguments:
2630+
- ignore-directories: ["testcases", "testinfo"]
26042631
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range
26052632
- name: range
26062633
severity: warning
@@ -2738,6 +2765,11 @@ linters:
27382765
severity: warning
27392766
disabled: false
27402767
exclude: [""]
2768+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unsecure-url-scheme
2769+
- name: unsecure-url-scheme
2770+
severity: warning
2771+
disabled: false
2772+
exclude: [""]
27412773
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-parameter
27422774
- name: unused-parameter
27432775
severity: warning
@@ -2767,11 +2799,21 @@ linters:
27672799
severity: warning
27682800
disabled: false
27692801
exclude: [""]
2802+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-waitgroup-go
2803+
- name: use-waitgroup-go
2804+
severity: warning
2805+
disabled: false
2806+
exclude: [""]
27702807
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
27712808
- name: useless-break
27722809
severity: warning
27732810
disabled: false
27742811
exclude: [""]
2812+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-fallthrough
2813+
- name: useless-fallthrough
2814+
severity: warning
2815+
disabled: false
2816+
exclude: [""]
27752817
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-declaration
27762818
- name: var-declaration
27772819
severity: warning

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ require (
8383
github.com/maratori/testpackage v1.1.1
8484
github.com/matoous/godox v1.1.0
8585
github.com/mattn/go-colorable v0.1.14
86-
github.com/mgechev/revive v1.11.0
86+
github.com/mgechev/revive v1.12.0
8787
github.com/mitchellh/go-homedir v1.1.0
8888
github.com/moricho/tparallel v0.3.2
8989
github.com/nakabonne/nestif v0.3.1

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,10 @@
613613
"function-result-limit",
614614
"get-return",
615615
"identical-branches",
616+
"identical-ifelseif-branches",
617+
"identical-ifelseif-conditions",
618+
"identical-switch-branches",
619+
"identical-switch-conditions",
616620
"if-return",
617621
"import-alias-naming",
618622
"import-shadowing",
@@ -627,6 +631,7 @@
627631
"nested-structs",
628632
"optimize-operands-order",
629633
"package-comments",
634+
"package-directory-mismatch",
630635
"range-val-address",
631636
"range-val-in-closure",
632637
"range",
@@ -650,12 +655,15 @@
650655
"unnecessary-format",
651656
"unnecessary-stmt",
652657
"unreachable-code",
658+
"unsecure-url-scheme",
653659
"unused-parameter",
654660
"unused-receiver",
655661
"use-any",
656662
"use-errors-new",
657663
"use-fmt-print",
664+
"use-waitgroup-go",
658665
"useless-break",
666+
"useless-fallthrough",
659667
"var-declaration",
660668
"var-naming",
661669
"waitgroup-by-value"

pkg/golinters/revive/revive.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func safeTomlSlice(r []any) []any {
269269
}
270270

271271
// This element is not exported by revive, so we need copy the code.
272-
// Extracted from https://github.com/mgechev/revive/blob/v1.11.0/config/config.go#L166
272+
// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L16
273273
var defaultRules = []lint.Rule{
274274
&rule.VarDeclarationsRule{},
275275
&rule.PackageCommentsRule{},
@@ -329,6 +329,10 @@ var allRules = append([]lint.Rule{
329329
&rule.FunctionResultsLimitRule{},
330330
&rule.GetReturnRule{},
331331
&rule.IdenticalBranchesRule{},
332+
&rule.IdenticalIfElseIfBranchesRule{},
333+
&rule.IdenticalIfElseIfConditionsRule{},
334+
&rule.IdenticalSwitchBranchesRule{},
335+
&rule.IdenticalSwitchConditionsRule{},
332336
&rule.IfReturnRule{},
333337
&rule.ImportAliasNamingRule{},
334338
&rule.ImportsBlocklistRule{},
@@ -340,6 +344,7 @@ var allRules = append([]lint.Rule{
340344
&rule.ModifiesValRecRule{},
341345
&rule.NestedStructs{},
342346
&rule.OptimizeOperandsOrderRule{},
347+
&rule.PackageDirectoryMismatchRule{},
343348
&rule.RangeValAddress{},
344349
&rule.RangeValInClosureRule{},
345350
&rule.RedundantBuildTagRule{},
@@ -356,18 +361,21 @@ var allRules = append([]lint.Rule{
356361
&rule.UnhandledErrorRule{},
357362
&rule.UnnecessaryFormatRule{},
358363
&rule.UnnecessaryStmtRule{},
364+
&rule.UnsecureURLSchemeRule{},
359365
&rule.UnusedReceiverRule{},
360366
&rule.UseAnyRule{},
361367
&rule.UseErrorsNewRule{},
362368
&rule.UseFmtPrintRule{},
363369
&rule.UselessBreak{},
370+
&rule.UselessFallthroughRule{},
371+
&rule.UseWaitGroupGoRule{},
364372
&rule.WaitGroupByValueRule{},
365373
}, defaultRules...)
366374

367375
const defaultConfidence = 0.8
368376

369377
// This element is not exported by revive, so we need copy the code.
370-
// Extracted from https://github.com/mgechev/revive/blob/v1.11.0/config/config.go#L198
378+
// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L206
371379
func normalizeConfig(cfg *lint.Config) {
372380
// NOTE(ldez): this custom section for golangci-lint should be kept.
373381
// ---
@@ -409,7 +417,7 @@ func normalizeConfig(cfg *lint.Config) {
409417
}
410418

411419
// This element is not exported by revive, so we need copy the code.
412-
// Extracted from https://github.com/mgechev/revive/blob/v1.11.0/config/config.go#L266
420+
// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L274
413421
func defaultConfig() *lint.Config {
414422
defaultConfig := lint.Config{
415423
Confidence: defaultConfidence,
@@ -455,7 +463,7 @@ func extractRulesName(rules []lint.Rule) []string {
455463
return names
456464
}
457465

458-
// Extracted from https://github.com/mgechev/revive/blob/v1.11.0/formatter/severity.go
466+
// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/formatter/severity.go
459467
// Modified to use pointers (related to hugeParam rule).
460468
func severity(cfg *lint.Config, failure *lint.Failure) lint.Severity {
461469
if cfg, ok := cfg.Rules[failure.RuleName]; ok && cfg.Severity == lint.SeverityError {

0 commit comments

Comments
 (0)