Skip to content

Commit 641c764

Browse files
authored
Merge pull request #2030 from mythi/PR-2025-007
ci: bump to golangi-lint v2
2 parents e5b2264 + d8eee50 commit 641c764

File tree

3 files changed

+69
-51
lines changed

3 files changed

+69
-51
lines changed

.github/workflows/lib-validate.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
sudo apt-get update
4545
sudo apt-get install -y libze1 libze-dev
4646
- name: golangci-lint
47-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6
47+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7
4848
with:
49-
version: v1.64.5
49+
version: v2.0.2
5050
args: -v --timeout 5m
5151
build:
5252
name: Build and check device plugins

.golangci.yml

+65-47
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1+
version: "2"
12
run:
2-
tests: true
33
build-tags:
44
- kerneldrv
5-
5+
tests: true
66
linters:
7-
disable-all: true
7+
default: none
88
enable:
99
- asciicheck
1010
- bodyclose
11+
- copyloopvar
1112
- dogsled
13+
- err113
1214
- errcheck
13-
- copyloopvar
1415
- gocognit
1516
- goconst
1617
- gocyclo
1718
- godot
18-
- err113
19-
- gofmt
20-
- goimports
2119
- gomodguard
22-
- gosimple
20+
- goprintffuncname
2321
- gosec
2422
- govet
25-
- goprintffuncname
2623
- ineffassign
2724
- misspell
2825
- nakedret
@@ -31,46 +28,67 @@ linters:
3128
- prealloc
3229
- revive
3330
- staticcheck
34-
- stylecheck
35-
- typecheck
3631
- unconvert
3732
- unused
3833
- whitespace
3934
- wsl
40-
41-
linters-settings:
42-
revive:
35+
settings:
36+
gocognit:
37+
min-complexity: 31
38+
gocyclo:
39+
min-complexity: 15
40+
govet:
41+
enable:
42+
- fieldalignment
43+
- shadow
44+
revive:
45+
rules:
46+
- name: unused-parameter
47+
disabled: true
48+
exclusions:
49+
generated: lax
50+
presets:
51+
- comments
52+
- common-false-positives
53+
- legacy
54+
- std-error-handling
4355
rules:
44-
- name: unused-parameter
45-
disabled: true
46-
gofmt:
47-
simplify: true
48-
goconst:
49-
ignore-tests: true
50-
govet:
51-
enable:
52-
- "fieldalignment"
53-
- "shadow"
54-
gocyclo:
55-
min-complexity: 15
56-
gocognit:
57-
min-complexity: 31
58-
59-
issues:
60-
exclude-rules:
61-
- linters:
62-
- gosec
63-
text: "G115"
64-
- path: _test\.go
65-
linters:
66-
- gocognit
67-
- wsl
68-
- gocyclo
69-
- path: test/e2e/
70-
linters:
71-
- wsl
72-
- gocognit
73-
- gocyclo
74-
- path: cmd/gpu_fakedev/
75-
linters:
76-
- wsl
56+
- linters:
57+
- staticcheck
58+
text: QF100(1|4|8)
59+
- linters:
60+
- gosec
61+
text: G115
62+
- linters:
63+
- gocognit
64+
- gocyclo
65+
- wsl
66+
path: _test\.go
67+
- linters:
68+
- gocognit
69+
- gocyclo
70+
- wsl
71+
path: test/e2e/
72+
- linters:
73+
- wsl
74+
path: cmd/gpu_fakedev/
75+
- linters:
76+
- goconst
77+
path: (.+)_test\.go
78+
paths:
79+
- third_party$
80+
- builtin$
81+
- examples$
82+
formatters:
83+
enable:
84+
- gofmt
85+
- goimports
86+
settings:
87+
gofmt:
88+
simplify: true
89+
exclusions:
90+
generated: lax
91+
paths:
92+
- third_party$
93+
- builtin$
94+
- examples$

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""
1010

1111
CERT_MANAGER_VERSION ?= v1.15.2
1212
CONTROLLER_GEN_VERSION ?= v0.17.0
13-
GOLANGCI_LINT_VERSION ?= v1.64.5
13+
GOLANGCI_LINT_VERSION ?= v2.0.2
1414
KIND_VERSION ?= v0.23.0
1515
GOLICENSES_VERSION ?= v1.6.0
1616
# Default bundle image tag
@@ -44,7 +44,7 @@ vendor:
4444

4545
install-tools:
4646
GO111MODULE=on $(GO) install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
47-
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
47+
$(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
4848
$(GO) install sigs.k8s.io/kind@${KIND_VERSION}
4949

5050
go-mod-tidy:

0 commit comments

Comments
 (0)