Skip to content

Commit 6ba5f63

Browse files
build(deps): bump github.com/mgechev/revive from 1.4.0 to 1.5.0 (#5113)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent c4b6d37 commit 6ba5f63

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

.golangci.next.reference.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,16 +2496,33 @@ linters-settings:
24962496
disabled: false
24972497
exclude: [""]
24982498
arguments:
2499-
- "preserveScope"
25002499
- "checkPrivateReceivers"
2501-
- "sayRepetitiveInsteadOfStutters"
2500+
- "disableStutteringCheck"
2501+
- "checkPublicInterface"
2502+
- "disableChecksOnFunctions"
25022503
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header
25032504
- name: file-header
25042505
severity: warning
25052506
disabled: false
25062507
exclude: [""]
25072508
arguments:
25082509
- This is the text that must appear at the top of source files.
2510+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-length-limit
2511+
- name: file-length-limit
2512+
severity: warning
2513+
disabled: false
2514+
exclude: [""]
2515+
arguments:
2516+
- max: 100
2517+
skipComments: true
2518+
skipBlankLines: true
2519+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#filename-format
2520+
- name: filename-format
2521+
severity: warning
2522+
disabled: false
2523+
exclude: [""]
2524+
arguments:
2525+
- "^[_a-z][_a-z0-9]*.go$"
25092526
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
25102527
- name: flag-parameter
25112528
severity: warning
@@ -2633,6 +2650,8 @@ linters-settings:
26332650
severity: warning
26342651
disabled: false
26352652
exclude: [""]
2653+
arguments:
2654+
- maxLength: 2
26362655
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
26372656
- name: redefines-builtin-id
26382657
severity: warning

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ require (
7575
github.com/maratori/testpackage v1.1.1
7676
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26
7777
github.com/mattn/go-colorable v0.1.13
78-
github.com/mgechev/revive v1.4.0
78+
github.com/mgechev/revive v1.5.0
7979
github.com/mitchellh/go-homedir v1.1.0
8080
github.com/mitchellh/go-ps v1.0.0
8181
github.com/moricho/tparallel v0.3.2
@@ -164,7 +164,7 @@ require (
164164
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
165165
github.com/magiconair/properties v1.8.6 // indirect
166166
github.com/mattn/go-isatty v0.0.20 // indirect
167-
github.com/mattn/go-runewidth v0.0.9 // indirect
167+
github.com/mattn/go-runewidth v0.0.16 // indirect
168168
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
169169
github.com/mitchellh/mapstructure v1.5.0 // indirect
170170
github.com/olekukonko/tablewriter v0.0.5 // indirect
@@ -179,6 +179,7 @@ require (
179179
github.com/quasilyte/gogrep v0.5.0 // indirect
180180
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
181181
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
182+
github.com/rivo/uniseg v0.4.7 // indirect
182183
github.com/shoenig/go-m1cpu v0.1.6 // indirect
183184
github.com/spf13/afero v1.11.0 // indirect
184185
github.com/spf13/cast v1.5.0 // indirect

go.sum

Lines changed: 7 additions & 3 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@
248248
"errorf",
249249
"exported",
250250
"file-header",
251+
"file-length-limit",
252+
"filename-format",
251253
"flag-parameter",
252254
"function-length",
253255
"function-result-limit",

pkg/golinters/revive/revive.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ func toIssue(pass *analysis.Pass, object *jsonObject) goanalysis.Issue {
184184
// This function mimics the GetConfig function of revive.
185185
// This allows to get default values and right types.
186186
// https://github.com/golangci/golangci-lint/issues/1745
187-
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L218
188-
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L170-L176
187+
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L220
188+
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L172-L178
189189
func getConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
190190
conf := defaultConfig()
191191

@@ -284,7 +284,7 @@ func safeTomlSlice(r []any) []any {
284284
}
285285

286286
// This element is not exported by revive, so we need copy the code.
287-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L16
287+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L16
288288
var defaultRules = []lint.Rule{
289289
&rule.VarDeclarationsRule{},
290290
&rule.PackageCommentsRule{},
@@ -368,12 +368,14 @@ var allRules = append([]lint.Rule{
368368
&rule.EnforceSliceStyleRule{},
369369
&rule.MaxControlNestingRule{},
370370
&rule.CommentsDensityRule{},
371+
&rule.FileLengthLimitRule{},
372+
&rule.FilenameFormatRule{},
371373
}, defaultRules...)
372374

373375
const defaultConfidence = 0.8
374376

375377
// This element is not exported by revive, so we need copy the code.
376-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L181
378+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L183
377379
func normalizeConfig(cfg *lint.Config) {
378380
// NOTE(ldez): this custom section for golangci-lint should be kept.
379381
// ---
@@ -419,7 +421,7 @@ func normalizeConfig(cfg *lint.Config) {
419421
}
420422

421423
// This element is not exported by revive, so we need copy the code.
422-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L181
424+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L252
423425
func defaultConfig() *lint.Config {
424426
defaultConfig := lint.Config{
425427
Confidence: defaultConfidence,

0 commit comments

Comments
 (0)