-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
162 lines (157 loc) · 4.88 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
run:
build-tags:
- "integration"
timeout: 5m
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
# - cyclop
# Measuring code complexity is hard. Cyclomatic complexity is doubtfully
# a reliable metric for this purpose. Some problems are complex by nature
# and therefore more cyclomatically complex code might actually be
# simpler.
# - deadcode # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- errname
- errcheck
- errchkjson
- errorlint
- execinquery
- exhaustive
# - exhaustivestruct
# We frequently make use of zero-values and partial initialization.
# - exhaustruct
# We frequently make use of zero-values and partial initialization.
- exportloopref
- forbidigo
- forcetypeassert
- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
# - godox
# TODOs and FIXMEs function as a big warning sign: "Beware! This code has
# bugs and other problems. Be careful not to make things worse when
# editing. Or better fix the issues before implementing a new feature on
# top.". The idea of [`godox` comment
# extractor](https://github.com/766b/godox) seems to be different from
# the idea of [`godox` linter](https://github.com/matoous/godox). The
# first one lets you quickly browse through the code problems, while the
# second one asks you to remove that big warning sign in favor of tasks.
# Though tasks are great, they will not help you while editing.
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
# - golint # Replaced by `revive`.
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
# - ifshort # deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
- importas
# - ireturn # See: https://github.com/go-proverbs/go-proverbs.github.io/issues/37.
- ineffassign
- interfacebloat
# - interfacer # Is prone to bad suggestions (officialy deprecated).
- ireturn
- lll
- loggercheck
- maintidx
# - maligned # Replaced by `govet`'s `fieldalignment`
- makezero
- misspell
- musttag
- nakedret
- nestif
- nilnil # Zero-value of maps, slices and channels is `nil` but useful.
- nilerr
# - nlreturn # Too subjective.
- noctx
- nolintlint
- nonamedreturns
# - nosnakecase # deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
# - scopelint # Replaced by `exportloopref`.
- sqlclosecheck
- staticcheck
# - structcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- stylecheck
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- usestdlibvars
# - varnamelen
# Though the idea is idiomatic, the length is not the only thing that
# determines whether a variable is "easy to use".
- unused
# - varcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- wastedassign
- whitespace
# - wrapcheck # Is prone to bad suggestions (especially see issue #1).
# - wsl # Too aggressive. Might be useful if it could do auto fix.
linters-settings:
forbidigo:
forbid:
- os.Exit # it's not safe to exit in random places, because defer will not work.
- log.Fatal.* # it calls os.Exit (see above)
lll:
line-length: 110
gci:
local-prefixes: github.com/enapter/rockamalg
nolintlint:
require-explanation: true
require-specific: true
issues:
exclude-rules:
- path: _test\.go
linters:
- forcetypeassert # it's ok to have some type risks in tests
- gosec # security is not make sense in tests
- noctx # it's ok to do simple http request without context in tests
- gomnd # it's by default for tests, but luatest and integration are helpers for tests
# False positive: https://github.com/kunwardeep/paralleltest/issues/8.
- linters:
- paralleltest
text: "does not use range value in test Run"
# We allow to os.Exit in main, tests, scripts and generators.
- path: main.go|main_test.go
linters:
- forbidigo
text: "forbidden by pattern `os.Exit`"