-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.golangci.yml
More file actions
191 lines (159 loc) · 2.83 KB
/
.golangci.yml
File metadata and controls
191 lines (159 loc) · 2.83 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
# Websoft9 project golangci-lint configuration
# Based on development standard document requirements
# Compatible with golangci-lint v1.x format
run:
timeout: 5m
tests: false
go: "1.21"
output:
formats:
- format: colored-line-number
linters-settings:
govet:
enable:
- shadow
gocyclo:
min-complexity: 15
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
lll:
line-length: 260
goimports:
local-prefixes: github.com/websoft9
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
funlen:
lines: 100
statements: 50
gocognit:
min-complexity: 30
nestif:
min-complexity: 15
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
gomodguard:
allowed:
modules: []
domains: []
blocked:
modules: []
versions: []
godox:
keywords:
- NOTE
- OPTIMIZE
- HACK
dogsled:
max-blank-identifiers: 2
whitespace:
multi-if: false
multi-func: false
linters:
disable-all: true
enable:
# Error checking
- errcheck
- staticcheck # includes gosimple, stylecheck
- govet
- ineffassign
- typecheck
- unused
# Security checking
- gosec
# Performance checking
- bodyclose
- rowserrcheck
- sqlclosecheck
# Code quality
# - dupl
- goconst
- gocritic
- mnd # replaces gomnd
- goprintffuncname
- nakedret
- prealloc
- unconvert
- unparam
# Complexity checking
- gocyclo
- gocognit
- funlen
- nestif
# Others
- dogsled
- godox
- gomodguard
- misspell
- whitespace
- lll
# Formatting
- gofmt
- goimports
issues:
exclude-dirs:
- vendor
- .git
- bin
- build
exclude-files:
- ".*\\.pb\\.go$"
- ".*_mock\\.go$"
exclude-rules:
# Exclude certain checks for test files
- path: '_test\.go'
linters:
- mnd
- funlen
- goconst
- dupl
# Exclude generated files
- path: ".*\\.pb\\.go"
linters:
- lll
- govet
# Exclude mock files
- path: ".*_mock\\.go"
linters:
- govet
- errcheck
# Exclude complexity check for main function
- text: "cyclomatic complexity"
source: "func main\\("
max-issues-per-linter: 0
max-same-issues: 0
severity:
default-severity: error
case-sensitive: false
rules:
- linters:
- dupl
- mnd
- goconst
severity: warning
- linters:
- gosec
- errcheck
- govet
severity: error