Merge pull request #97 from ytsarev/update-golangci-yml

Update golangci-lint configuration to work with latest linter versions
This commit is contained in:
Philippe Scorsolini 2025-03-24 11:39:38 +01:00 committed by GitHub
commit 45bc905d9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 16 deletions

View File

@ -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
@ -116,7 +111,7 @@ linters:
- misspell - misspell
- nakedret - nakedret
- nolintlint - nolintlint
disable: disable:
# These linters are all deprecated as of golangci-lint v1.49.0. We disable # These linters are all deprecated as of golangci-lint v1.49.0. We disable
# them explicitly to avoid the linter logging deprecation warnings. # them explicitly to avoid the linter logging deprecation warnings.
@ -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:
@ -181,7 +179,7 @@ issues:
linters: linters:
- gosec - gosec
- gas - gas
# Some k8s dependencies do not have JSON tags on all fields in structs. # Some k8s dependencies do not have JSON tags on all fields in structs.
- path: k8s.io/ - path: k8s.io/
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