-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
181 lines (166 loc) · 3.44 KB
/
Copy path.golangci.yml
File metadata and controls
181 lines (166 loc) · 3.44 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
170
171
172
173
174
175
176
177
178
179
180
181
version: "2"
run:
concurrency: 4
timeout: 5m
modules-download-mode: readonly
allow-parallel-runners: true
go: "1.25"
output:
formats:
tab:
colors: true
sort-order: [ "file","linter","severity" ]
linters:
enable:
- gosec
- noctx
- errcheck
- bodyclose
- sqlclosecheck
- nestif
- nilnil
- rowserrcheck
- forcetypeassert
- errname
- errorlint
- dogsled
- exhaustive
- funlen
- goconst
- gocritic
- gocyclo
- staticcheck
- unconvert
- unparam
- wastedassign
- prealloc
- misspell
- goprintffuncname
- lll
- testifylint
- forbidigo
- asciicheck
- depguard
disable:
- depguard
- gochecknoglobals
- gocognit
- godox
- nakedret
- exhaustive
- whitespace
- wrapcheck
- wsl
- exhaustruct
- revive
exclusions:
generated: lax
rules:
- path: migrations/
linters:
- revive
- funlen
- gochecknoinits
- goimports
- forbidigo
- contextcheck
- path: _test\.go
linters:
- gocyclo
- lll
- funlen
- path: pkg/grpc/
linters:
- gosec
- path: pkg/pb/
linters:
- gosec
- text: "G404: Use of weak random number generator"
linters:
- gosec
- text: "G401: Crypto primitive"
linters:
- gosec
- text: "G501: Blacklisted import crypto/md5"
linters:
- gosec
- text: "don't use math/rand in security-sensitive context"
linters:
- gosec
settings:
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 15
gosec:
severity: high
confidence: high
excludes:
- G104
- G401
- G404
- G501
- G505
lll:
line-length: 160
misspell:
locale: US
nestif:
min-complexity: 4
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
- name: package-comments
disabled: true
- name: exported
disabled: true
- name: indent-error-flow
- name: if-return
- name: var-naming
- name: receiver-naming
- name: error-naming
forbidigo:
forbid:
- pattern: "panic"
msg: "Do not use panic in production code"
- pattern: "errors.Errorf"
msg: "Use github.com/pkg/errors.Errorf instead of errors.Errorf"
depguard:
rules:
Main:
files: [ "$all" ]
allow:
- "$gostd" # Standard library
- "github.com/pkg/errors"
- "github.com/dgrijalva/jwt-go/v4"
- "github.com/tidwall/gjson"
- "github.com/golang/mock/gomock"
- "github.com/stretchr/testify"
- "github.com/alicebob/miniredis/v2"
- "go.mongodb.org"
deny:
- pkg: "errors"
desc: "use github.com/pkg/errors instead"
issues:
fix: true
max-same-issues: 50
max-issues-per-linter: 50