Update golangci configuration to work with latest linter versions
* Follow golangci-lint config verify errors and fix according to the latest https://golangci-lint.run/usage/configuration/ and https://golangci-lint.run/usage/linters * It should proactively fix the associated pipeline failures Signed-off-by: Yury Tsarev <yury@upbound.io>
This commit is contained in:
parent
353c5fe6e0
commit
115fb89b1e
|
@ -1,12 +1,10 @@
|
||||||
run:
|
run:
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
|
|
||||||
skip-files:
|
|
||||||
- "zz_generated\\..+\\.go$"
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
||||||
format: colored-line-number
|
formats:
|
||||||
|
- format: colored-line-number
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
errcheck:
|
errcheck:
|
||||||
|
@ -18,14 +16,15 @@ linters-settings:
|
||||||
# default is false: such cases aren't reported by default.
|
# default is false: such cases aren't reported by default.
|
||||||
check-blank: false
|
check-blank: false
|
||||||
|
|
||||||
# [deprecated] comma-separated list of pairs of the form pkg:regex
|
# List of functions to exclude from checking, where each entry is a single function to exclude.
|
||||||
# the regex is used to ignore names within pkg. (default "fmt:.*").
|
# See https://github.com/kisielk/errcheck#excluding-functions for details.
|
||||||
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
|
exclude-functions:
|
||||||
ignore: fmt:.*,io/ioutil:^Read.*
|
- io/ioutil.ReadFile
|
||||||
|
|
||||||
govet:
|
govet:
|
||||||
# report about shadowed variables
|
# report about shadowed variables
|
||||||
check-shadowing: false
|
disable:
|
||||||
|
- shadow
|
||||||
|
|
||||||
gofmt:
|
gofmt:
|
||||||
# simplify code: gofmt with `-s` option, true by default
|
# simplify code: gofmt with `-s` option, true by default
|
||||||
|
@ -45,10 +44,6 @@ linters-settings:
|
||||||
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
||||||
min-complexity: 10
|
min-complexity: 10
|
||||||
|
|
||||||
maligned:
|
|
||||||
# print struct with more effective memory layout or not, false by default
|
|
||||||
suggest-new: true
|
|
||||||
|
|
||||||
dupl:
|
dupl:
|
||||||
# tokens count to trigger issue, 150 by default
|
# tokens count to trigger issue, 150 by default
|
||||||
threshold: 100
|
threshold: 100
|
||||||
|
@ -135,6 +130,9 @@ linters:
|
||||||
issues:
|
issues:
|
||||||
# Excluding configuration per-path and per-linter
|
# Excluding configuration per-path and per-linter
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
|
- path: "zz_generated\\..+\\.go$"
|
||||||
|
linters: ["all"]
|
||||||
|
|
||||||
# Exclude some linters from running on tests files.
|
# Exclude some linters from running on tests files.
|
||||||
- path: _test(ing)?\.go
|
- path: _test(ing)?\.go
|
||||||
linters:
|
linters:
|
||||||
|
@ -202,7 +200,7 @@ issues:
|
||||||
new: false
|
new: false
|
||||||
|
|
||||||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
||||||
max-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
|
|
||||||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
|
|
Loading…
Reference in New Issue