-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
198 lines (164 loc) · 5.17 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
# Base file: https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
run:
timeout: 5m
tests: true
skip-dirs: []
skip-files: []
output:
# Format: colored-line-number|line-number|json|colored-tab|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity
#
# Multiple can be specified by separating them by comma, output can be provided
# for each of them by separating format name and path by colon symbol.
# Output path can be either `stdout`, `stderr` or path to the file to write to.
#
# Example: "checkstyle:report.xml,json:stdout,colored-line-number"
formats: 'colored-line-number'
print-issued-lines: false
print-linter-name: true
uniq-by-line: true
sort-results: true
linters-settings:
errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
check-blank: true
# List of functions to exclude from checking, where each entry is a single function to exclude.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
exclude-functions: []
funlen:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
lines: -1
# Checks the number of statements in a function.
# If lower than 0, disable the check.
statements: 50
# Ignore comments when counting lines.
ignore-comments: true
goconst:
# Minimal length of string constant.
min-len: 2
# Minimum occurrences of constant string count to trigger issue.
min-occurrences: 2
# Ignore test files.
ignore-tests: false
# Search also for duplicated numbers.
numbers: true
gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks'.
# See https://go-critic.github.io/overview#checks-overview.
# enabled-checks:
# Which checks should be disabled; can't be combined with 'enabled-checks'.
# disabled-checks: []
# See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- diagnostic
- style
- performance
- experimental
- opinionated
# Settings passed to gocritic.
# The settings key is the name of a supported gocritic checker.
# The list of supported checkers can be find in https://go-critic.github.io/overview.
settings:
captLocal:
# Whether to restrict checker to params only.
paramsOnly: false
elseif:
# Whether to skip balanced if-else pairs.
skipBalanced: false
hugeParam:
# Size in bytes that makes the warning trigger.
sizeThreshold: 70
ifElseChain:
# Min number of if-else blocks that makes the warning trigger.
minThreshold: 2
nestingReduce:
# Min number of statements inside a branch to trigger a warning.
bodyWidth: 5
gocyclo:
# Minimal code complexity to report.
min-complexity: 12
godot:
# Comments to be checked: `declarations`, `toplevel`, or `all`.
scope: declarations
# List of regexps for excluding particular comment lines from check.
exclude:
# Exclude todo comments.
- '^TODO:'
# Check that each sentence ends with a period.
period: true
# Check that each sentence starts with a capital letter.
capital: true
gofmt:
# Simplify code: gofmt with `-s` option.
simplify: true
# Apply the rewrite rules to the source before reformatting.
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'a[b:len(a)]'
replacement: 'a[b:]'
gosec:
# To select a subset of rules to run.
# Available rules: https://github.com/securego/gosec#available-rules
includes: []
# To specify a set of rules to explicitly exclude.
excludes:
- G204 # Audit use of command execution
- G304 # File path provided as taint input
# Exclude generated files.
exclude-generated: false
# Filter out the issues with a lower severity than the given value.
# Valid options are: low, medium, high.
# Default: low
severity: low
# Filter out the issues with a lower confidence than the given value.
# Valid options are: low, medium, high.
confidence: low
govet:
# Report about shadowed variables.
check-shadowing: false
lll:
# Max line length, lines longer will be reported.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option.
line-length: 200
# Tab width in spaces.
tab-width: 1
revive:
rules:
- name: unexported-return
disabled: true
- name: unused-parameter
linters:
# Disable all linters.
disable-all: true
# Enable specific linters.
enable:
- gofmt
- govet
- gosec
- gocyclo
- gocritic
- goimports
- godot
- errcheck
- goconst
- funlen
- lll
- revive
- dogsled
- bodyclose
- errorlint
- copyloopvar
- gocheckcompilerdirectives
- mnd
- goprintffuncname
- gosimple
- ineffassign
- stylecheck
- unconvert
- unparam
- unused
- whitespace
- nolintlint