-
Notifications
You must be signed in to change notification settings - Fork 3
/
.golangci.yml
219 lines (217 loc) · 6.25 KB
/
.golangci.yml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
govet:
check-shadowing: false
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
golint:
min-confidence: 0.8
gofmt:
simplify: true
maligned:
suggest-new: true
dupl:
threshold: 200
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
ignore-words:
- blocksmith
- smithing
- smith
- tx
- txs
- smithtime
- blockseed
- coinbase
- zoobc
- multisig
lll:
line-length: 150
goimports:
local-prefixes: github.com/zoobc/zoobc-core
gocritic:
settings:
hugeParam:
sizeThreshold: 512
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845
- exitAfterDefer
- importShadow
- appendAssign
funlen:
l: 50
s: 55
linters:
enable-all: true
disable:
- gocyclo
- maligned
- prealloc
- gochecknoglobals
- gochecknoinits
- gocognit
- ineffassign
fast: false
run:
skip-dirs:
- vendor
- common/schema
skip-files:
- common/model/*.pb.*.go
- common/service/*.pb.*.go
issues:
exclude-rules:
- text: "Using the variable on range scope"
linters:
- scopelint
- text: "`derivate` is a misspelling of `derivative`"
linters:
- misspell
- text: "captLocal:"
linters:
- gocritic
- text: "G401: Use of weak cryptographic primitive"
linters:
- gosec
- text: "Blacklisted import `crypto/md5`"
linters:
- gosec
- text: "do not compare errors directly"
linters:
- goerr113
- text: "do not define dynamic errors"
linters:
- goerr113
- text: "Expect WriteFile permissions to be 0600 or less"
linters:
- gosec
- text: "is deeply nested"
linters:
- nestif
- text: "Top level comment should end in a period"
linters:
- godot
- text: "package should be "
linters:
- testpackage
- text: "should be"
linters:
- stylecheck
- text: "rows.Err must be checked"
linters:
- rowserrcheck
- text: "mnd: Magic number"
linters:
- gomnd
- text: "always receives"
linters:
- unparam
- text: "ifElseChain: rewrite if-else to switch statement"
linters:
- gocritic
- text: "rangeValCopy: each iteration copies"
linters:
- gocritic
- text: "cuddle"
linters:
- wsl
- text: "block should not start with a whitespace"
linters:
- wsl
- text: "block should not end with a whitespace"
linters:
- wsl
- text: "go statements can only invoke functions assigned on line above"
linters:
- wsl
- text: "unnecessary trailing newline"
linters:
- whitespace
- text: "unnecessary leading newline"
linters:
- whitespace
- text: "should not use underscores in Go names"
linters:
- stylecheck
- text: "blank identifiers"
linters:
- dogsled
- text: "Line contains TODO/BUG/FIXME"
linters:
- godox
- text: "G202: SQL string concatenation"
linters:
- gosec
- text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
linters:
- gosec
- text: "is too long"
linters:
- funlen
- text: "has too many statements"
linters:
- funlen
- text: "occurrences, make it a constant"
linters:
- goconst
- text: "G201: SQL string formatting"
linters:
- gosec
- path: "(.+)_test.go"
linters:
- scopelint
- unused
- path: "(.+)_test.go"
text: "sync.noCopy"
linters:
- govet
- path: "(.+)_test.go"
text: "G404: Use of weak random number generator"
linters:
- gosec
- path: "(.+)_test.go"
text: "copylocks: literal copies lock value"
linters:
- govet
- path: "(.+).go"
text: "type name will be used as"
- path: "(.+)_test.go"
text: "copylocks: range var tt copies lock:"
linters:
- govet
- text: "File is not `goimports`-ed"
linters:
- goimports
- text: "lines are duplicate of"
linters:
- dupl
- text: "U1000: func `TransactionBodyInterface.isTransaction_TransactionBody` is unused"
linters:
- unused
- text: "don't use underscores in Go names; method isTransaction_TransactionBody should be isTransactionTransactionBody"
linters:
- golint
- text: "exported method ParseBodyBytes returns unexported type"
linters:
- golint
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.17.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"