-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy path.golangci.toml
More file actions
201 lines (170 loc) · 3.68 KB
/
.golangci.toml
File metadata and controls
201 lines (170 loc) · 3.68 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
version = '2'
[run]
issues-exit-code = 1
tests = true
allow-parallel-runners = false
relative-path-mode = 'gitroot'
[output]
path-prefix = ''
[output.formats]
[output.formats.text]
path = 'stdout'
print-linter-name = true
print-issued-lines = true
[linters]
default = 'all'
disable = [
'asciicheck',
'canonicalheader',
'containedctx',
'copyloopvar',
'cyclop',
'depguard',
'dogsled',
'dupl',
'dupword',
'err113',
'exhaustive',
'exhaustruct',
'forbidigo',
'funlen',
'gochecknoglobals',
'gocognit',
'goconst',
'gocyclo',
'godox',
'goheader',
'gomoddirectives',
'importas',
'inamedparam',
'intrange',
'ireturn',
'lll',
'mnd',
'musttag',
'nilnil',
'nlreturn',
'noinlineerr',
'nonamedreturns',
'paralleltest',
'perfsprint',
'prealloc',
'promlinter',
'protogetter',
'tagliatelle',
'testpackage',
'thelper',
'unparam',
'varnamelen',
'wrapcheck',
'wsl',
'wsl_v5'
]
[linters.settings]
[linters.settings.errorlint]
errorf = true
asserts = true
comparison = true
[linters.settings.forbidigo]
[[linters.settings.forbidigo.forbid]]
pattern = 'time.After\.*(# use of time After can create memory allocation issues see https://github.com/github/go-linter/tree/main/doc/time_after.md )?'
[linters.settings.gocritic]
disabled-checks = [
'importShadow',
]
enabled-tags = [
'diagnostic',
'performance',
'style'
]
[linters.settings.gocritic.settings]
[linters.settings.gocritic.settings.hugeParam]
sizeThreshold = 256
[linters.settings.gocritic.settings.rangeValCopy]
sizeThreshold = 256
[linters.settings.gosec]
excludes = [
'G204', # Audit use of exec.Command with variable arguments (command injection risk)
'G304', # Audit file path provided as taint input (path traversal via user-supplied file paths)
'G307', # Deferring a method which returns an error (e.g., defer f.Close() without checking the error)
'G702', # net/http SetDeadline not called (HTTP server timeout not configured)
'G703', # Path traversal via taint analysis
'G706', # Audit use of io.ReadAll (potential denial of service from unbounded reads)
]
[linters.settings.govet]
disable = [
'fieldalignment',
'shadow',
]
enable-all = true
[linters.settings.modernize]
disable = ["any"]
[linters.settings.nestif]
min-complexity = 6
[linters.settings.nolintlint]
require-explanation = true
require-specific = true
allow-unused = false
[linters.settings.revive]
confidence = 0.8
severity = 'error'
enable-all-rules = true
[[linters.settings.revive.rules]]
name = 'comment-spacings'
arguments = [
'nolint'
]
[[linters.settings.revive.rules]]
name = 'argument-limit'
disabled = true
[[linters.settings.revive.rules.arguments]]
acceptIgnoredAssertionResult = false
[[linters.settings.revive.rules]]
name = 'unhandled-error'
arguments = [
'fmt.Print',
'fmt.Printf',
'fmt.Println',
'os.Setenv',
'os.Unsetenv'
]
disabled = false
[[linters.settings.revive.rules]]
name = 'add-constant'
disabled = true
[[linters.settings.revive.rules]]
name = 'flag-parameter'
disabled = true
[[linters.settings.revive.rules]]
name = 'cognitive-complexity'
disabled = true
[[linters.settings.revive.rules]]
name = 'cyclomatic'
disabled = true
[[linters.settings.revive.rules]]
name = 'function-length'
disabled = true
[[linters.settings.revive.rules]]
name = 'line-length-limit'
disabled = true
[[linters.settings.revive.rules]]
name = 'max-public-structs'
disabled = true
[[linters.settings.revive.rules]]
name = 'redundant-test-main-exit'
disabled = true
[[linters.settings.revive.rules]]
name = 'use-any'
disabled = true
[issues]
max-issues-per-linter = 0
max-same-issues = 0
uniq-by-line = true
new = false
fix = false
[severity]
default = 'error'
[formatters]
enable = [
'goimports'
]