bump(golangci-lint): update and migrate

golangci-lint migrate to make .golangci.yaml v2 compatible
This commit is contained in:
Jan Chaloupka
2026-02-17 21:53:53 +01:00
parent 760e9cc2e1
commit 91c1297a54
2 changed files with 35 additions and 15 deletions
+32 -14
View File
@@ -1,18 +1,36 @@
run:
timeout: 5m
version: "2"
linters:
disable-all: true
default: none
enable:
- gocyclo
- govet
- misspell
# - staticcheck // TODO: enable later once the code is properly updated
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- gofumpt
- gosimple
- gocyclo
- misspell
- govet
linters-settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes: sigs.k8s.io/descheduler
#- goimports // TODO: enable later once the code is properly updated
settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- sigs.k8s.io/descheduler
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
+3 -1
View File
@@ -26,7 +26,7 @@ ARCHS = amd64 arm arm64
LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION}.buildDate=${BUILD} -X ${LDFLAG_LOCATION}.gitbranch=${BRANCH} -X ${LDFLAG_LOCATION}.gitsha1=${SHA1}"
GOLANGCI_VERSION := v1.64.8
GOLANGCI_VERSION := v2.8.0
HAS_GOLANGCI := $(shell ls _output/bin/golangci-lint 2> /dev/null)
GOFUMPT_VERSION := v0.7.0
@@ -149,12 +149,14 @@ ifndef HAS_GOLANGCI
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./_output/bin ${GOLANGCI_VERSION}
endif
./_output/bin/golangci-lint run -v
./_output/bin/golangci-lint fmt -v
fmt:
ifndef HAS_GOFUMPT
go install mvdan.cc/gofumpt@${GOFUMPT_VERSION}
endif
gofumpt -w -extra .
goimports -w pkg metrics test
# helm