mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
fix golangci-lint config file using exclude-rules
golangci configuration file disable soon to be deprecated golangci linters remove useless comments on golangci config
This commit is contained in:
parent
ca7cfb75d0
commit
86e197991a
@ -5,27 +5,35 @@ run:
|
|||||||
|
|
||||||
issues:
|
issues:
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
|
# Excluding configuration per-path, per-linter, per-text and per-source
|
||||||
|
exclude-rules:
|
||||||
|
# exclude ineffassing linter for generated files for conversion
|
||||||
|
- path: conversion\.go
|
||||||
|
linters:
|
||||||
|
- ineffassign
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
enable: # please keep this alphabetized
|
enable: # please keep this alphabetized
|
||||||
- deadcode
|
# Don't use soon to deprecated[1] linters that lead to false
|
||||||
|
# https://github.com/golangci/golangci-lint/issues/1841
|
||||||
|
# - deadcode
|
||||||
|
# - structcheck
|
||||||
|
# - varcheck
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
|
||||||
linters-settings: # please keep this alphabetized
|
linters-settings: # please keep this alphabetized
|
||||||
staticcheck:
|
staticcheck:
|
||||||
go: "1.17"
|
go: "1.17"
|
||||||
checks: [
|
checks: [
|
||||||
"all",
|
"all",
|
||||||
"-S1*", # Omit code simplifications for now.
|
"-S1*", # TODO(fix) Omit code simplifications for now.
|
||||||
"-ST1*", # Mostly stylistic, redundant w/ golint
|
"-ST1*", # Mostly stylistic, redundant w/ golint
|
||||||
"-SA5011" # Possible nil pointer dereference
|
"-SA5011", # TODO(fix) Possible nil pointer dereference
|
||||||
]
|
"-SA1019", # TODO(fix) Using a deprecated function, variable, constant or field
|
||||||
ignore_pattern: [
|
"-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
|
||||||
"vendor/k8s.io/kubectl/pkg/cmd/edit/testdata", # golang/go#24854, dominikh/go-tools#565
|
|
||||||
"cluster/addons/fluentd-elasticsearch/es-image" # cannot traverse go modules
|
|
||||||
]
|
]
|
||||||
unused:
|
unused:
|
||||||
go: "1.17"
|
go: "1.17"
|
||||||
|
Loading…
Reference in New Issue
Block a user