-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
194 lines (191 loc) · 4.11 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
194
---
# golangci.com configuration
# https://golangci-lint.run/usage/configuration/
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 15m
linters:
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
# containedctx
# contextcheck
- cyclop
# deadcode Replaced by unused.
- decorder
# depguard Need to be fixed with new depguard version
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- execinquery
# exhaustive
# exhaustivestruct
# exhaustruct
- exportloopref
- forbidigo
# forcetypeassert
- funlen
# gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
# goerr113
- gofmt
- goheader
# goimports
# golint Replaced by revive.
- gomnd
# gomoddirectives replacement are not allowed:
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- lll
- loggercheck
- maintidx
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
# nonamedreturns
- nosprintfhostport
# paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- staticcheck
# structcheck Replaced by unused.
# stylecheck
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
# wrapcheck
# wsl
# Run only fast linters from enabled linters set (first run won't be fast)
# Default: false
fast: false
linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 12
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
package-average: 0.0
# Should ignore tests.
# Default: false
skip-tests: true
funlen:
lines: 120
statements: 120
goconst:
min-len: 5
min-occurrences: 5
importas:
# Do not allow unaliased imports of aliased packages.
# Default: false
no-unaliased: true
# Do not allow non-required aliases.
# Default: false
no-extra-aliases: false
# List of aliases
# Default: []
alias:
- pkg: knative.dev/serving/pkg/apis/serving/v1
alias: servingv1
lll:
line-length: 180
tab-width: 1
misspell:
locale: US
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 8
revive:
ignore-generated-header: true
severity: warning
rules:
- name: atomic
- name: line-length-limit
severity: error
arguments: [330]
tagliatelle:
# Check the struct tag name case.
case:
# Use the struct field name to check the name of the struct tag.
# Default: false
use-field-name: true
# `camel` is used for `json` and `yaml` (can be overridden)
# Default: {}
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`,
# `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
json: snake
yaml: camel
xml: camel
bson: camel
avro: snake
mapstructure: kebab
issues:
exclude-rules:
- path: pkg/authorizer/metadata_authorizer.go
linters:
- cyclop
- gocognit
- nestif
- path: _test\.go
linters:
- cyclop
- funlen
- gochecknoglobals
- gocritic
- gosec
- typecheck
- unparam
- path: pkg/protostore/protostore_test.go
linters:
- maintidx
- path: pkg/logutils/logger.go
linters:
- gochecknoglobals
- path: pkg/datastore/sql_struct.go
linters:
- gochecknoglobals
- path: test/data.go
linters:
- gochecknoglobals
- path: test/helper.go
linters:
- gomnd