From 6ba5f63d284699fec7cbb619d20b9b8b7d66b652 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:09:19 +0100 Subject: [PATCH] build(deps): bump github.com/mgechev/revive from 1.4.0 to 1.5.0 (#5113) Co-authored-by: Fernandez Ludovic --- .golangci.next.reference.yml | 23 +++++++++++++++++++++-- go.mod | 5 +++-- go.sum | 10 +++++++--- jsonschema/golangci.next.jsonschema.json | 2 ++ pkg/golinters/revive/revive.go | 12 +++++++----- 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index e479284a512d..afc4caa38e4d 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -2496,9 +2496,10 @@ 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 @@ -2506,6 +2507,22 @@ linters-settings: 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 @@ -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 diff --git a/go.mod b/go.mod index c16201b36633..d614180e8851 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 71408a3b404b..4c655f93141f 100644 --- a/go.sum +++ b/go.sum @@ -368,12 +368,13 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgechev/revive v1.4.0 h1:+6LDNE1XKsUCkpuDOMrzjOsXqiQOZ/jPlscLyA6mMXw= -github.com/mgechev/revive v1.4.0/go.mod h1:uzGR6feiCiJi4oND58/KMt/lEnR5vmjzRYPZiR0sQRQ= +github.com/mgechev/revive v1.5.0 h1:oaSmjA7rP8+HyoRuCgC531VHwnLH1AlJdjj+1AnQceQ= +github.com/mgechev/revive v1.5.0/go.mod h1:L6T3H8EoerRO86c7WuGpvohIUmiploGiyoYbtIWFmV8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= @@ -460,6 +461,9 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4l github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/raeperd/recvcheck v0.1.2 h1:SjdquRsRXJc26eSonWIo8b7IMtKD3OAT2Lb5G3ZX1+4= github.com/raeperd/recvcheck v0.1.2/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index fd96911cc5b8..66d80f641209 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -248,6 +248,8 @@ "errorf", "exported", "file-header", + "file-length-limit", + "filename-format", "flag-parameter", "function-length", "function-result-limit", diff --git a/pkg/golinters/revive/revive.go b/pkg/golinters/revive/revive.go index 2e9e058b3341..056a258e0a17 100644 --- a/pkg/golinters/revive/revive.go +++ b/pkg/golinters/revive/revive.go @@ -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() @@ -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{}, @@ -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. // --- @@ -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,