ci: cleanup golangci configuration

While running golangci there are messages logged about deprecated
configuration options and deactivated linters. The golangci.yml file
needs a few small corrections to address those warnings.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2025-03-20 18:08:32 +01:00 committed by mergify[bot]
parent f13005bda9
commit 91baf7681d

View File

@ -23,25 +23,27 @@ run:
# include test files or not, default is true
tests: true
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- vendor$
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
issues:
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
exclude-dirs:
- vendor$
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate,
# default is "colored-line-number"
format: colored-line-number
formats:
- format: colored-line-number
# print lines of code with issue, default is true
print-issued-lines: true
@ -67,9 +69,6 @@ linters-settings:
# path to a file containing a list of functions to exclude from checking
# see https://github.com/kisielk/errcheck#excluding-functions for details
# exclude: /path/to/file.txt
govet:
# report about shadowed variables
check-shadowing: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
@ -183,14 +182,12 @@ linters:
- wsl
- funlen
- testpackage
- exhaustivestruct
- nosnakecase
# This requires extra addition of unnecessary code. Hence, we
# prefer to disable this linter. But, it can be enabled if we
# have better resolution. For more details check the
# issue below.
# see: https://github.com/ceph/ceph-csi/issues/1227
- goerr113
- err113
- forbidigo
# TODO: enable gomoddirectives
- gomoddirectives
@ -202,7 +199,6 @@ linters:
# TODO: enable linters added in golangci-lint 1.43
- contextcheck
- mnd
- gomnd
- ireturn
- tagliatelle
- varnamelen