Skip to content

Commit f411702

Browse files
author
shijiashuai
committed
fix(ci): update golangci-lint config to v2 format
- version as string "2" - linters-settings -> linters.settings - issues.exclude-rules -> linters.exclusions.rules - add linters.default: none
1 parent 4e613c8 commit f411702

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

.golangci.yml

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
version: 2
1+
version: "2"
22

33
run:
44
timeout: 3m
55
modules-download-mode: readonly
66

77
linters:
8+
default: none
89
enable:
910
- errcheck
1011
- govet
1112
- ineffassign
1213
- staticcheck
1314
- unused
14-
- gosimple
1515
- gocritic
1616
- revive
1717
- misspell
@@ -24,38 +24,40 @@ linters:
2424
- tparallel # Test parallelization
2525
- unparam # Unused parameters
2626

27-
linters-settings:
28-
gocritic:
29-
enabled-tags:
30-
- diagnostic
31-
- style
32-
disabled-checks:
33-
- hugeParam
34-
revive:
27+
settings:
28+
gocritic:
29+
enabled-tags:
30+
- diagnostic
31+
- style
32+
disabled-checks:
33+
- hugeParam
34+
revive:
35+
rules:
36+
- name: blank-imports
37+
- name: context-as-argument
38+
- name: dot-imports
39+
- name: error-return
40+
- name: error-strings
41+
- name: exported
42+
disabled: true
43+
- name: increment-decrement
44+
- name: var-naming
45+
- name: package-comments
46+
disabled: true
47+
misspell:
48+
locale: US
49+
gosec:
50+
severity: medium
51+
confidence: medium
52+
53+
exclusions:
3554
rules:
36-
- name: blank-imports
37-
- name: context-as-argument
38-
- name: dot-imports
39-
- name: error-return
40-
- name: error-strings
41-
- name: exported
42-
disabled: true
43-
- name: increment-decrement
44-
- name: var-naming
45-
- name: package-comments
46-
disabled: true
47-
misspell:
48-
locale: US
49-
gosec:
50-
severity: medium
51-
confidence: medium
55+
# Exclude some linters from running on tests files
56+
- path: _test\.go
57+
linters:
58+
- gosec
59+
- errcheck
5260

5361
issues:
5462
max-issues-per-linter: 50
5563
max-same-issues: 5
56-
exclude-rules:
57-
# Exclude some linters from running on tests files
58-
- path: _test\.go
59-
linters:
60-
- gosec
61-
- errcheck

0 commit comments

Comments
 (0)