-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
172 lines (146 loc) · 3.03 KB
/
.golangci.yml
File metadata and controls
172 lines (146 loc) · 3.03 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
run:
timeout: 5m
issues-exit-code: 0
tests: true
output:
print-issued-lines: true
print-linter-name: true
sort-results: true
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
exclude-functions:
- (*os.File).Close
- (*database/sql.Rows).Close
- (*database/sql.Stmt).Close
govet:
enable-all: true
disable:
- fieldalignment
- shadow
gocyclo:
min-complexity: 15
dupl:
threshold: 100
goconst:
min-len: 3
min-occurrences: 3
misspell:
locale: US
lll:
line-length: 120
goimports:
local-prefixes: github.com/SharanRP/gh-notif
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
funlen:
lines: 100
statements: 50
gocognit:
min-complexity: 20
nestif:
min-complexity: 4
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
ignored-numbers:
- "0"
- "1"
- "2"
- "3"
ignored-functions:
- "strings.SplitN"
godox:
keywords:
- NOTE
- OPTIMIZE
- HACK
depguard:
rules:
main:
deny:
- pkg: "github.com/sirupsen/logrus"
desc: "logging is allowed only by logutils.Log"
whitespace:
multi-if: false
multi-func: false
linters:
disable-all: true
enable: [] # Disable all linters for now
issues:
exclude-files:
- ".*\\.pb\\.go$"
- ".*_generated\\.go$"
exclude-dirs:
- vendor
- .git
- .github
- docs
- scripts
uniq-by-line: true
exclude-rules:
- path: _test\.go
linters:
- mnd
- funlen
- gocyclo
- errcheck
- dupl
- gosec
- path: cmd/
linters:
- gochecknoinits
- path: main\.go
linters:
- gochecknoinits
- linters:
- lll
source: "^//go:generate "
- linters:
- gocritic
text: "unnecessaryDefer:"
exclude:
- 'declaration of "(err|ctx)" shadows declaration at'
- 'shadow: declaration of "err" shadows declaration'
- 'shadow: declaration of "ctx" shadows declaration'
# Ignore common patterns that are not critical
- 'Magic number:'
- 'Line is \d+ characters'
- 'Function .* is too long'
- 'should rewrite.*NewRequestWithContext'
- 'could use.*instead'
- 'unnecessary conversion'
- 'result .* is always nil'
- 'result .* is never used'
- '.* is unused'
- 'duplicate of.*'
# Ignore specific error patterns
- 'Error return value.*is not checked'
- 'ineffectual assignment'
- 'SA1019:.*deprecated'
- 'func .* is unused'
- 'type .* is unused'
- 'field .* is unused'
max-issues-per-linter: 10 # Limit issues per linter
max-same-issues: 3 # Limit same issues
new: false
severity:
default-severity: error
case-sensitive: false