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:
Antonio Ojea 2021-11-16 16:56:41 +01:00
parent ca7cfb75d0
commit 86e197991a

View File

@ -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.
"-S1*", # TODO(fix) 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
"-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 isnt allowed
]
unused:
go: "1.17"