-
Notifications
You must be signed in to change notification settings - Fork 7
/
.golangci.yml
173 lines (170 loc) · 5.06 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
run:
tests: true
linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: github.com/iotaledger
gocyclo:
min-complexity: 15
govet:
disable:
- shadow
misspell:
locale: US
staticcheck:
checks: ["all"]
nlreturn:
block-size: 2
stylecheck:
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
depguard:
rules:
main:
deny:
- pkg: "errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "golang.org/x/xerrors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "github.com/pkg/errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
linters:
# Disable all linters.
disable-all: true
# Enable specific linter
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
#- containedctx
#- contextcheck # this linter is buggy and renders all nolint rules useless
- copyloopvar
#- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- execinquery
#- exhaustive
#- exhaustruct
- exportloopref
#- forbidigo
- forcetypeassert
#- funlen
#- gci
- ginkgolinter
- gocheckcompilerdirectives
#- gochecknoglobals
#- gochecknoinits
#- gochecksumtype
#- gocognit
- goconst
- gocritic
#- gocyclo
- godot
- godox
- goerr113
- gofmt
#- gofumpt
- goheader
- goimports
#- gomnd
#- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- grouper
- importas
- inamedparam
#- interfacebloat
- intrange
#- ireturn
#- lll
- loggercheck
#- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
#- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
#- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- stylecheck
#- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
#- varnamelen
- wastedassign
- whitespace
#- wrapcheck
#- wsl
- zerologlint
issues:
exclude-files:
- ".*_test.go$"
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
#exclude:
# - 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked' # errcheck
# - "err113: do not define dynamic errors, use wrapped static errors instead:" # goerr113
# - "type name will be used as [0-9A-Za-z_.]+ by other packages, and that stutters; consider calling this" # golint
# - "Potential file inclusion via variable" # gosec
# - "G404: Use of weak random number generator" # gosec
# - "Subprocess launch(ed with variable|ing should be audited)" # gosec
# - "Use of unsafe calls should be audited" # gosec
# - "G108: Profiling endpoint is automatically exposed on /debug/pprof" # gosec
# - "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)" # gosec
# - "G101: Potential hardcoded credentials" # gosec
# - "(G104|G307)" # gosec Duplicated errcheck checks.
# - "`[0-9A-Za-z_.]+` - `[0-9A-Za-z_.]+` always receives `[0-9A-Za-z_.]+`" # unparam
# - "should have comment .*or be unexported" # revive
# - "exported: comment on exported" # revive
# - "package-comments: package comment should be of the form" # revive
# - "blank-imports" # revive
# - "var-naming: don't use leading k in Go names;" #revive
# - 'shadow: declaration of "err"' # govet