-
Notifications
You must be signed in to change notification settings - Fork 56
/
.golangci.yaml
198 lines (193 loc) · 5.3 KB
/
.golangci.yaml
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
---
# yamllint disable rule:line-length
# Ref template: https://github.com/golangci/golangci-lint/blob/v1.37.1/.golangci.example.yml
# options for analysis running
run:
timeout: 5m
# all available settings of specific linters
linters-settings:
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
exhaustive:
# check switch statements in generated files also
check-generated: true
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
goheader:
template: |
SPDX-FileCopyrightText: The RamenDR authors
SPDX-License-Identifier: Apache-2.0
misspell:
locale: US
promlinter:
strict: true
wsl:
allow-trailing-comment: true
enforce-err-cuddling: true
revive:
ignore-generated-header: false
severity: error
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
- name: atomic
- name: constant-logical-expr
- name: unnecessary-stmt
- name: get-return
- name: modifies-parameter
- name: modifies-value-receiver
- name: range-val-in-closure
- name: waitgroup-by-value
- name: call-to-gc
- name: duplicated-imports
- name: unhandled-error
# - name: flag-parameter
# - name: unused-receiver
# - name: unused-parameter
# - name: confusing-naming
# - name: import-shadowing
# - name: confusing-results
# - name: bool-literal-in-expr
issues:
exclude-rules:
# Allow dot imports for ginkgo and gomega
- source: ginkgo|gomega
linters:
- revive
text: "should not use dot imports"
- source: "^func Test"
linters:
- funlen
- source: "^//"
linters:
- lll
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
# - copyloopvar // Additional new replacement for go 1.22 (https://go.dev/blog/loopvar-preview) (deprecating exportloopref)
- cyclop
# - deadcode // Fully deprecated, remove this line once an alternative is enabled for the same
- decorder
# - depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errchkjson
# - errorlint
# - execinquery // Fully deprecated, remove this line once an alternative is enabled for the same
- exhaustive
- forbidigo
- funlen
- gocognit
# - goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
# - golint // Fully deprecated, remove this line once an alternative is enabled for the same
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
# - ifshort // Fully deprecated, remove this line once an alternative is enabled for the same
- importas
- ineffassign
- interfacebloat
- lll
- loggercheck
- maintidx
- makezero
# - maligned // Fully deprecated, remove this line once an alternative is enabled for the same
- misspell
- mnd
# - nakedret
- nestif
- nilerr
- nlreturn
- noctx
# - nolintlint
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
# - scopelint // Fully deprecated, remove this line once an alternative is enabled for the same
- sqlclosecheck
# - structcheck // Fully deprecated, remove this line once an alternative is enabled for the same
- stylecheck
- tenv
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
# - varcheck // Fully deprecated, remove this line once an alternative is enabled for the same
- wastedassign
- whitespace
- wsl
# - gochecknoglobals
# - gochecknoinits
# - godot
# - godox
# - paralleltest
# - goerr113 # TODO: Need to introduce error definition and bring this back
# - goheader # TODO: Introduce back post fixing linter errors
# - gci
# - interfacer # interfacer linter is archived and deprecated (https://github.com/mvdan/interfacer)
# - exhaustruct
# - tagliatelle
# - gomoddirectives
# - goimports
# - wrapcheck
# - varnamelen
# - staticcheck
# - nosnakecase
# - ireturn
# - nilnil
# - containedctx
# - nonamedreturns
# - forcetypeassert
# - contextcheck
# - errname