mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +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:
|
||||
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:
|
||||
disable-all: true
|
||||
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
|
||||
- staticcheck
|
||||
- unused
|
||||
- varcheck
|
||||
|
||||
linters-settings: # please keep this alphabetized
|
||||
staticcheck:
|
||||
go: "1.17"
|
||||
checks: [
|
||||
"all",
|
||||
"-S1*", # Omit code simplifications for now.
|
||||
"-ST1*", # Mostly stylistic, redundant w/ golint
|
||||
"-SA5011" # Possible nil pointer dereference
|
||||
]
|
||||
ignore_pattern: [
|
||||
"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
|
||||
"-S1*", # TODO(fix) Omit code simplifications for now.
|
||||
"-ST1*", # Mostly stylistic, redundant w/ golint
|
||||
"-SA5011", # TODO(fix) Possible nil pointer dereference
|
||||
"-SA1019", # TODO(fix) Using a deprecated function, variable, constant or field
|
||||
"-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
|
||||
]
|
||||
unused:
|
||||
go: "1.17"
|
||||
|
Loading…
Reference in New Issue
Block a user