-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
160 lines (135 loc) · 3.41 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
# options for analysis running
run:
concurrency: 4
timeout: 1m
issues-exit-code: 1
tests: true
skip-dirs:
- mocks
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
# format: github-actions
# sorts results by: filepath, line and column
sort-results: true
# all available settings of specific linters
linters-settings:
dogsled:
max-blank-identifiers: 2
errcheck:
check-type-assertions: true
check-blank: true
errorlint:
errorf: true
asserts: true
comparison: true
exhaustive:
check-generated: false
default-signifies-exhaustive: true
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
nestif:
min-complexity: 3
goconst:
min-len: 3
min-occurrences: 3
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
goimports:
local-prefixes: github.com/faunists/deal
gomnd:
settings:
mnd:
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
checks: argument,condition,return,assign
gomoddirectives:
replace-local: true
retract-allow-no-explanation: true
exclude-forbidden: true
govet:
# report about shadowed variables
check-shadowing: true
enable-all: true
disable:
- fieldalignment
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: 100
# tab width in spaces. Default to 1.
tab-width: 4
misspell:
locale: US
revive:
# see https://github.com/mgechev/revive#available-rules for details.
ignore-generated-header: true
severity: warning
rules:
- name: indent-error-flow
severity: warning
- name: add-constant
severity: warning
arguments:
- maxLitCount: "3"
allowStrs: '"","SimpleMessage","MessageWithComplexFields"'
allowInts: "0,1,2"
allowFloats: "0.0,0.,1.0,1.,2.0,2."
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.15"
# https://staticcheck.io/docs/options#checks
checks: [ "all" ]
testpackage:
# regexp pattern to skip files
skip-regexp: (export|internal)_test\.go
thelper:
test:
first: true
name: true
begin: true
benchmark:
first: true
name: true
begin: true
tb:
first: true
name: true
begin: true
unused:
go: "1.16"
linters:
disable-all: true
enable:
- dogsled
- errcheck
- errorlint
- exhaustive
- gocognit
- nestif
- goconst
- gofmt
- goimports
- gomnd
- gomoddirectives
- govet
- lll
- misspell
- revive
- staticcheck
- thelper
- unused
fast: false
issues:
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: false
exclude-case-sensitive: true
# Show only new issues created after git revision `REV`
new-from-rev: HEAD~
# Fix found issues (if it's supported by the linter)
fix: false