Skip to content

build(deps): bump github.com/mgechev/revive from 1.4.0 to 1.5.0 #5113

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
Nov 7, 2024
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
23 changes: 21 additions & 2 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2492,16 +2492,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 @@ -2629,6 +2646,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
Loading