Repository navigation
Expand file tree
/
Copy path.golangci.yaml
More file actions
169 lines (165 loc) · 3.3 KB
/
Copy path.golangci.yaml
File metadata and controls
169 lines (165 loc) · 3.3 KB
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
version: "2"
issues:
max-same-issues: 50
formatters:
enable:
- gci
- gofmt
- goimports
- golines
exclusions:
generated: lax
settings:
golines:
max-len: 120
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- copyloopvar
- decorder
- cyclop
- depguard
- dupl
- durationcheck
- err113
- errcheck
- errname
- errorlint
- exptostd
- fatcontext
- forbidigo
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gochecksumtype
- goconst
- gocritic
- gocyclo
- godox
- goheader
- godot
- gomoddirectives
- goprintffuncname
- gosec
- importas
- inamedparam
- interfacebloat
- govet
- iface
- ineffassign
- intrange
- ireturn
- loggercheck
- makezero
- mirror
- modernize
- musttag
- nakedret
- nestif
- nilerr
- nilnesserr
- nilnil
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- testableexamples
- testifylint
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace
settings:
cyclop:
max-complexity: 30
depguard:
rules:
"deprecated":
files:
- "$all"
deny:
- pkg: github.com/golang/protobuf
desc: Use google.golang.org/protobuf instead, see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules
- pkg: github.com/satori/go.uuid
desc: Use github.com/google/uuid instead, satori's package is not maintained
- pkg: github.com/gofrs/uuid$
desc: Use github.com/gofrs/uuid/v5 or later, it was not a go module before v5
"non-test files":
files:
- "!$test"
deny:
- pkg: math/rand$
desc: Use math/rand/v2 instead, see https://go.dev/blog/randv2
"non-main files":
files:
- "!**/main.go"
deny:
- pkg: log$
desc: Use log/slog instead, see https://go.dev/blog/slog
errcheck:
check-type-assertions: true
funlen:
lines: 100
statements: 50
gocritic:
settings:
captLocal:
paramsOnly: false
underef:
skipRecvDeref: false
gosec:
excludes:
- G306
govet:
enable-all: true
disable:
- fieldalignment
- shadow
inamedparam:
skip-single-param: true
nakedret:
max-func-lines: 0
nestif:
min-complexity: 15
nolintlint:
allow-no-explanation: [funlen, gocognit, golines]
require-specific: true
perfsprint:
strconcat: false
usetesting:
os-temp-dir: true
exclusions:
warn-unused: true
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: _test\.go
linters:
- dupl
- err113
- errcheck
- gocyclo
- gosec