-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.golangci.yml
193 lines (171 loc) · 3.98 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
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.28.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"
# options for analysis running
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
concurrency: 5
timeout: 5m
skip-dirs:
- pkg/grpc
- test
linters:
disable-all: true
enable:
- bodyclose
# - deadcode
- depguard
- dogsled
- dupl
- errcheck
- funlen
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- nolintlint
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
# - unused
- varcheck
- whitespace
- asciicheck
- gocognit
- nestif
# all available settings of specific linters
linters-settings:
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 160
funlen:
lines: 60
statements: 40
errcheck:
check-type-assertions: false
check-blank: true
govet:
check-shadowing: true
enable:
# atomicalign
enable-all: false
disable:
# - shadow
disable-all: false
maligned:
suggest-new: true
auto-fix: true
depguard:
list-type: blacklist
include-go-root: false
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
ignore-words:
- someword
nakedret:
max-func-lines: 30
# unused:
# check-exported: true
unparam:
check-exported: false
gocritic:
enabled-checks:
disabled-checks:
enabled-tags:
- performance
settings: # settings passed to gocritic
captLocal: # must be valid enabled check name
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 3
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- linters:
- golint
text: don't use an underscore in package name
- linters:
- gosec
# G401: Use of weak cryptographic primitive
# G501: Blacklisted import `crypto/md5`: weak cryptographic primitive
text: G(401|501|108|107|404)
- linters:
- stylecheck
# ST1003: should not use underscores in package names
text: ST1003
- path: _test.go
linters:
- lll
- errcheck
- godox
- scopelint
- govet
- gocyclo
- unused
- funlen
- unparam
- path: pkg/grpc
linters:
- unused
- path: internal/producer/protocol/http/http.go
linters:
- gocritic
- gosimple
- dupl
- path: internal/producer/interceptor/porm/porm.go
linters:
- gocritic
- gosimple
- dupl
- path: pkg/http/server.go
linters:
- gocritic
- gosimple
- dupl
- gosec
- path: pkg/http/client.go
linters:
- gocritic
- gosimple
- dupl
- gosec
- golint
- funlen