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: 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 isnt 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"