-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.golangci.yml
154 lines (150 loc) · 3.28 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
run:
timeout: 10m
issue-exit-code: 1
skip-dirs-use-default: true
skip-dirs:
- docs
- hack
- internal/pkg/static
modules-download-mode: readonly
allow-parallel-runners: true
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
format: tab
linters:
disable-all: true
enable:
- bodyclose
- dogsled
- dupl
- depguard
- errcheck
- exhaustive
- exportloopref
- gofmt
- gosimple
- goimports
- govet
- godox
- gosec
- goheader
- ineffassign
- nakedret
- nolintlint
- misspell
- lll
- predeclared
- revive
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unused
- unconvert
- unparam
- whitespace
issues:
exclude:
- G101 # Potential hardcoded credentials
max-same-issues: 20
exclude-rules:
- linters:
- dogsled
text: "declaration has 3 blank identifiers"
path: _test\.go
- linters:
- dupl
path: _test\.go
- linters:
- golint
text: "should not use dot imports|don't use an underscore in package name"
- linters:
- goheader
source: "^//go:build"
- linters:
- goheader
text: "Helm"
- linters:
- goheader
text: "Kubernetes"
- linters:
- goheader
text: "SPDX-License-Identifier"
- linters:
- goheader
text: "Authors"
linters-settings:
gofmt:
simplify: true
gocyclo:
min-complexity: 10
golint:
min-confidence: 0.8
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 3
errcheck:
check-blank: false
check-type-assertions: false
gofumpt:
extra-rules: false
lang-version: "1.19"
govet:
enable-all: true
disable:
- shadow
- fieldalignment
revive:
confidence: 0.8
severity: warning
errorCode: 0
warningCode: 0
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- 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
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
# tab width in spaces. Default to 1.
tab-width: 1
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
godox:
keywords:
- BUG
- FIXME
- TODO
- HACK
stylecheck:
dot-import-whitelist:
- fmt
goheader:
template-path: .go-header.txt