Skip to content

Commit 3dc9330

Browse files
committed
refactor: migrate .golangci.yml to v2 format
- Change version from number to string - Move linters-settings to linters.settings - Replace disable-all with default: none - Move issues.exclude-rules to linters.exclusions.rules - Maintain all linter configurations and exclusions
1 parent 88733fe commit 3dc9330

1 file changed

Lines changed: 38 additions & 38 deletions

File tree

.golangci.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
version: 2
2-
3-
linters-settings:
4-
govet:
5-
check-shadowing: true
6-
gocyclo:
7-
min-complexity: 15
8-
dupl:
9-
threshold: 100
10-
goconst:
11-
min-len: 2
12-
min-occurrences: 2
13-
misspell:
14-
locale: US
15-
lll:
16-
line-length: 140
17-
gocritic:
18-
enabled-tags:
19-
- diagnostic
20-
- experimental
21-
- opinionated
22-
- performance
23-
- style
24-
disabled-checks:
25-
- hugeParam # 88 bytes for Settings struct is acceptable for a builder pattern API
1+
version: "2"
262

273
linters:
28-
disable-all: true
4+
default: none
295
enable:
306
- bodyclose
317
- dogsled
@@ -51,18 +27,42 @@ linters:
5127
- unused
5228
- whitespace
5329

54-
issues:
55-
exclude-rules:
56-
# Exclude some linters from running on tests files
57-
- path: _test\.go
58-
linters:
59-
- gocyclo
60-
- dupl
61-
- gosec
62-
- lll
63-
- errcheck # Test code often intentionally ignores errors
64-
- goconst # Test literals don't need to be constants
65-
- unparam # Test helpers may have unused params for consistency
30+
settings:
31+
govet:
32+
enable-all: true
33+
gocyclo:
34+
min-complexity: 15
35+
dupl:
36+
threshold: 100
37+
goconst:
38+
min-len: 2
39+
min-occurrences: 2
40+
misspell:
41+
locale: US
42+
lll:
43+
line-length: 140
44+
gocritic:
45+
enabled-tags:
46+
- diagnostic
47+
- experimental
48+
- opinionated
49+
- performance
50+
- style
51+
disabled-checks:
52+
- hugeParam # 88 bytes for Settings struct is acceptable for a builder pattern API
53+
54+
exclusions:
55+
rules:
56+
# Exclude some linters from running on test files
57+
- path: '_test\.go'
58+
linters:
59+
- gocyclo
60+
- dupl
61+
- gosec
62+
- lll
63+
- errcheck # Test code often intentionally ignores errors
64+
- goconst # Test literals don't need to be constants
65+
- unparam # Test helpers may have unused params for consistency
6666

6767
run:
6868
timeout: 5m

0 commit comments

Comments
 (0)