Skip to content

Commit 0ca13e0

Browse files
authored
chore(lint): migrate to golangci-lint v2 (#84)
refer: https://golangci-lint.run/product/migration-guide/#changes
1 parent e71bc5f commit 0ca13e0

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
go-version: '1.23'
3434

3535
- name: golangci-lint
36-
uses: golangci/golangci-lint-action@v6
36+
uses: golangci/golangci-lint-action@v7
3737
with:
3838
version: latest
3939

.golangci.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
---
1+
version: "2"
22
run:
33
concurrency: 6
44
timeout: 5m
55
modules-download-mode: readonly
66

77
linters:
8-
enable-all: true
8+
default: all
99
disable:
1010
# too many reports but requires attention
1111
- depguard
1212
- perfsprint
13-
- typecheck
1413
# useful hints that should be addressed
1514
- nakedret
1615
- gosmopolitan # usage of time.Local in pkg/k8s.io
@@ -30,8 +29,6 @@ linters:
3029
- thelper
3130
- forbidigo
3231
- exhaustive
33-
- gofumpt
34-
- gci
3532
- godot
3633
- dupl
3734
- funlen
@@ -53,23 +50,21 @@ linters:
5350
- nilnil
5451
- nonamedreturns
5552
- exhaustruct
56-
# deprecated linters
57-
- exportloopref
58-
59-
linters-settings:
60-
errcheck:
61-
check-blank: false
62-
nolintlint:
63-
allow-unused: true
64-
require-specific: true
65-
revive:
66-
rules:
53+
- revive
54+
settings:
55+
errcheck:
56+
check-blank: false
57+
nolintlint:
58+
allow-unused: true
59+
require-specific: true
60+
revive:
61+
rules:
6762
- name: unused-parameter
6863
disabled: true
69-
testifylint:
70-
enable-all: true
71-
mnd:
72-
ignored-numbers:
64+
testifylint:
65+
enable-all: true
66+
mnd:
67+
ignored-numbers:
7368
- '0755'
7469
- '0644'
7570
- '0744'
@@ -88,7 +83,6 @@ issues:
8883
# Set to 0 to disable.
8984
# Default: 3
9085
max-same-issues: 0
91-
exclude-dirs-use-default: true
9286
fix: true
9387

9488

0 commit comments

Comments
 (0)