This repository has been archived by the owner on Oct 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
159 lines (146 loc) · 3.05 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
run:
timeout: 1m
uniq-by-line: false
linters-settings:
dupl:
threshold: 100
errcheck:
exclude-functions:
- (net/http.ResponseWriter).Write
gocognit:
min-complexity: 10
gocritic:
enabled-checks:
- appendAssign
- appendCombine
- argOrder
- assignOp
- badCall
- badCond
- badLock
- badRegexp
- boolExprSimplify
- builtinShadow
- builtinShadowDecl
- captLocal
- caseOrder
- codegenComment
- commentedOutCode
- commentedOutImport
- commentFormatting
- defaultCaseOrder
- deferUnlambda
- deprecatedComment
- docStub
- dupArg
- dupBranchBody
- dupCase
- dupImport
- dupSubExpr
- elseif
- emptyFallthrough
- emptyStringTest
- equalFold
- evalOrder
- exitAfterDefer
- filepathJoin
- flagDeref
- flagName
- hexLiteral
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- initClause
- mapKey
- methodExprCall
- nestingReduce
- newDeref
- nilValReturn
- octalLiteral
- offBy1
- paramTypeCombine
- ptrToRefParam
- rangeExprCopy
- rangeValCopy
- regexpMust
- regexpPattern
- regexpSimplify
- ruleguard
- singleCaseSwitch
- sloppyLen
- sloppyReassign
- sloppyTypeAssert
- sortSlice
- sqlQuery
- stringXbytes
- switchTrue
- tooManyResultsChecker
- truncateCmp
- typeAssertChain
- typeDefFirst
- typeSwitchVar
- typeUnparen
- underef
# - unamedResult
- unlabelStmt
- unlambda
- unnecessaryBlock
- unnecessaryDefer
- unslice
- valSwap
- weakCond
# - whynolint
- wrapperFunc
- yodaStyleExpr
settings:
hugeParam:
sizeThreshold: 256
rangeValCopy:
sizeThreshold: 256
gofumpt:
lang-version: "1.17"
extra-rules: true
goimports:
local-prefixes: github.com/benchttp/worker
misspell:
locale: US
revive:
enableAllRules: true
staticcheck:
go: "1.17"
checks: [all]
stylecheck:
go: "1.17"
checks: [all]
linters:
disable-all: true
enable:
- bodyclose # enforce resp.Body.Close()
- deadcode
- dupl # duplicate code
- errcheck
- exportloopref
- gocognit # smart complexity analyzer
- gocritic # opinionated linter
- gofumpt # stricter gofmt
- goimports # imports order
- gosec # security checks
- govet
- misspell # typos in strings, comments
- prealloc # enforce capacity allocation when possible
- revive # golint enhancement
- staticcheck # go vet enhancement
- structcheck # unused struct fields
- testpackage # checks on tests (*_test)
- thelper # enforce t.Helper()
- varcheck # unused global var and const
- wastedassign
fast: false
issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- gocognit
- gocyclo