-
Notifications
You must be signed in to change notification settings - Fork 78
/
.golangci.yaml
130 lines (126 loc) · 2.82 KB
/
.golangci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
run:
concurrency: 4
timeout: "5m"
issues-exit-code: 1
tests: false
go: "1.20"
output:
sort-results: true
sort-order:
- file
- linter
show-stats: true
issues:
exclude-rules:
# we don't want to run these linters on e2e tests
- path: "./*test/e2e/.*"
linters:
- gocritic
- govet
- lll
- revive
- staticcheck
- unused
linters:
# fast: true
disable-all: true
enable:
- errcheck
- gci
- gocritic
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- lll
- revive
- staticcheck
- unused
linters-settings:
errcheck:
exclude-functions:
- (net/http.ResponseWriter).Write
- syscall.SetsockoptInt
- (go.opentelemetry.io/otel/metric.Meter).RegisterCallback
- k8s.io/apimachinery/pkg/util/wait.PollImmediate
- (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler
gci:
sections:
- standard
- default
- prefix(slime.io/)
gocritic:
enable-all: true
disabled-checks:
- singleCaseSwitch
- assignOp
settings:
ifElseChain:
minThreshold: 4
goimports:
local-prefixes: "slime.io"
govet:
disable:
- copylocks
- shadow
lll:
line-length: 120
revive:
confidence: 0.0
rules:
- name: atomic
- name: blank-imports
- name: bool-literal-in-expr
- name: call-to-gc
- name: constant-logical-expr
- name: datarace
- name: deep-exit
- name: defer
arguments:
- ["call-chain", "loop"]
- name: dot-imports
- name: duplicated-imports
- name: empty-block
- name: empty-lines
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: identical-branches
- name: if-return
- name: indent-error-flow
arguments:
- "preserveScope"
- name: modifies-parameter
- name: modifies-value-receiver
- name: range-val-in-closure
- name: range-val-address
- name: receiver-naming
- name: superfluous-else
arguments:
- "preserveScope"
- name: time-equal
- name: time-naming
- name: unconditional-recursion
- name: unexported-naming
- name: unreachable-code
- name: unused-parameter
- name: useless-break
- name: var-declaration
- name: waitgroup-by-value
# maybe enable in the future
- name: argument-limit
disabled: true
arguments: [5]
- name: cyclomatic
disabled: true
arguments: [15]
- name: exported
disabled: true
arguments:
- "preserveScope"
- "checkPrivateReceivers"
- "sayRepetitiveInsteadOfStutters"
- name: package-comments
disabled: true