Skip to content

Commit

Permalink
build(deps): bump github.com/mgechev/revive from 1.4.0 to 1.5.0 (#5113)
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 Nov 7, 2024
1 parent c4b6d37 commit 6ba5f63
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 12 deletions.
23 changes: 21 additions & 2 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2496,16 +2496,33 @@ linters-settings:
disabled: false
exclude: [""]
arguments:
- "preserveScope"
- "checkPrivateReceivers"
- "sayRepetitiveInsteadOfStutters"
- "disableStutteringCheck"
- "checkPublicInterface"
- "disableChecksOnFunctions"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header
- name: file-header
severity: warning
disabled: false
exclude: [""]
arguments:
- This is the text that must appear at the top of source files.
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-length-limit
- name: file-length-limit
severity: warning
disabled: false
exclude: [""]
arguments:
- max: 100
skipComments: true
skipBlankLines: true
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#filename-format
- name: filename-format
severity: warning
disabled: false
exclude: [""]
arguments:
- "^[_a-z][_a-z0-9]*.go$"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
- name: flag-parameter
severity: warning
Expand Down Expand Up @@ -2633,6 +2650,8 @@ linters-settings:
severity: warning
disabled: false
exclude: [""]
arguments:
- maxLength: 2
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
- name: redefines-builtin-id
severity: warning
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
github.com/maratori/testpackage v1.1.1
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26
github.com/mattn/go-colorable v0.1.13
github.com/mgechev/revive v1.4.0
github.com/mgechev/revive v1.5.0
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-ps v1.0.0
github.com/moricho/tparallel v0.3.2
Expand Down Expand Up @@ -164,7 +164,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
Expand All @@ -179,6 +179,7 @@ require (
github.com/quasilyte/gogrep v0.5.0 // indirect
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
Expand Down
10 changes: 7 additions & 3 deletions go.sum

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

2 changes: 2 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
"errorf",
"exported",
"file-header",
"file-length-limit",
"filename-format",
"flag-parameter",
"function-length",
"function-result-limit",
Expand Down
12 changes: 7 additions & 5 deletions pkg/golinters/revive/revive.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func toIssue(pass *analysis.Pass, object *jsonObject) goanalysis.Issue {
// This function mimics the GetConfig function of revive.
// This allows to get default values and right types.
// https://github.com/golangci/golangci-lint/issues/1745
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L218
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L170-L176
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L220
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L172-L178
func getConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
conf := defaultConfig()

Expand Down Expand Up @@ -284,7 +284,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.4.0/config/config.go#L16
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L16
var defaultRules = []lint.Rule{
&rule.VarDeclarationsRule{},
&rule.PackageCommentsRule{},
Expand Down Expand Up @@ -368,12 +368,14 @@ var allRules = append([]lint.Rule{
&rule.EnforceSliceStyleRule{},
&rule.MaxControlNestingRule{},
&rule.CommentsDensityRule{},
&rule.FileLengthLimitRule{},
&rule.FilenameFormatRule{},
}, defaultRules...)

const defaultConfidence = 0.8

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

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

0 comments on commit 6ba5f63

Please sign in to comment.