forked from ChainSafe/gossamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
190 lines (161 loc) · 5.15 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
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
# Copyright 2019 ChainSafe Systems (ON) Corp.
# This file is part of gossamer.
#
# The gossamer library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The gossamer library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the gossamer library. If not, see <http://www.gnu.org/licenses/>.
# Source: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
# options for analysis running
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m
# list of build tags, all linters use it. Default is empty list.
build-tags:
- integration
skip-files:
- .*mock_.*\.go
- .*mocks\/.*\.go
# all available settings of specific linters
linters-settings:
govet:
# report about shadowed variables
check-shadowing: true
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
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/davecgh/go-spew/spew
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
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: UK
ignore-words:
- gossamer
- flavor
gocritic:
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
- regexpMust # TODO remove this, `regexpMust` should be at global scope.
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- performance
settings: # settings passed to gocritic
captLocal: # must be valid enabled check name
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
linters:
enable:
- bodyclose
- depguard
- errcheck
- goconst
- gocyclo
- gofmt
- goimports
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- megacheck
- megacheck
- misspell
- nolintlint
- revive
- staticcheck
- unconvert
- unparam
- varcheck
fast: false
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
#exclude:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- ineffassign
- text: "exported: exported var Err*"
linters:
- revive
- text: 'shadow: declaration of "err" shadows declaration*'
linters:
- govet
- text: 'shadow: declaration of "ok" shadows declaration*'
linters:
- govet
- text: "`finalized` is a misspelling of `finalised`"
linters:
- misspell
- text: "`finalize` is a misspelling of `finalise`"
linters:
- misspell
- text: "`initialize` is a misspelling of `initialise`"
linters:
- misspell
- linters:
- revive
text: "package comment should be of the form"
- linters:
- revive
path: lib/runtime/life/
text: "don't use underscores in Go names;"
- linters:
- nolintlint
source: "^//nolint:revive"
# Exclude lll issues for long lines with go:generate
- linters:
- lll
source: "^//go:generate "
- source: "// https://"
linters:
- lll
- source: "// See https://"
linters:
- lll
- text: 'G204: Subprocess launched with variable'
linters:
- gosec
# 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
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0