Skip to content

Commit 78607a7

Browse files
committed
lint/golangci-lint: update golangci-lint config
1 parent b2a4fcd commit 78607a7

File tree

1 file changed

+126
-40
lines changed

1 file changed

+126
-40
lines changed

.golangci.yml

Lines changed: 126 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,88 @@
11
run:
2-
concurrency: 12
3-
deadline: 5m
42
issues-exit-code: 1
5-
tests: false
6-
# skip-dirs:
3+
tests: true
4+
skip-dirs:
5+
- "vendor$"
76
skip-files:
87
- ".*\\.pb\\.go"
9-
modules-download-mode: vendor
8+
- ".*(.|_)gen\\.go"
9+
modules-download-mode: readonly
1010

1111
linters-settings:
12-
depguard:
13-
list-type: blacklist
14-
include-go-root: false
15-
packages:
16-
- github.com/davecgh/go-spew/spew
12+
dupl:
13+
threshold: 400
1714
errcheck:
1815
check-type-assertions: true
1916
check-blank: true
2017
exclude: .errcheckignore
18+
funlen:
19+
lines: 80
20+
statements: 40
2121
goconst:
2222
min-len: 3
2323
min-occurrences: 3
24-
gofmt:
25-
simplify: true
26-
goimports:
27-
local-prefixes: github.com/go-language-server/jsonrpc2
28-
golint:
29-
min-confidence: 0.3
30-
govet:
31-
check-shadowing: false
3224
gocritic:
3325
enabled-tags:
3426
- diagnostic
35-
- style
36-
- performance
3727
- experimental
3828
- opinionated
29+
- performance
30+
- style
3931
settings:
40-
captLocal:
41-
paramsOnly: true
32+
hugeParam:
33+
sizeThreshold: 80
34+
rangeExprCopy:
35+
sizeThreshold: 512
4236
rangeValCopy:
43-
sizeThreshold: 32
37+
sizeThreshold: 128
38+
gocyclo:
39+
min-complexity: 10
40+
gofmt:
41+
simplify: true
42+
goimports:
43+
local-prefixes: github.com/go-language-server/jsonrpc2
44+
golint:
45+
min-confidence: 0.3
46+
govet:
47+
enable:
48+
- asmdecl
49+
- assign
50+
- atomic
51+
- atomicalign
52+
- bools
53+
- buildssa
54+
- buildtag
55+
- cgocall
56+
- composite
57+
- copylock
58+
- ctrlflow
59+
- deepequalerrors
60+
- errorsas
61+
- findcall
62+
- httpresponse
63+
- inspect
64+
- loopclosure
65+
- lostcancel
66+
- nilfunc
67+
- nilness
68+
- pkgfact
69+
- printf
70+
- shift
71+
- sortslice
72+
- stdmethods
73+
- structtag
74+
- tests
75+
- unmarshal
76+
- unreachable
77+
- unsafeptr
78+
- unusedresult
79+
disable:
80+
- shadow
81+
lll:
82+
line-length: 180
83+
tab-width: 1
84+
maligned:
85+
suggest-new: false
4486
misspell:
4587
locale: US
4688
nakedret:
@@ -53,45 +95,89 @@ linters-settings:
5395
algo: cha
5496
check-exported: true
5597
unused:
56-
check-exported: true
98+
check-exported: false
5799

58100
linters:
101+
# disabled:
102+
# - funlen
103+
# - gochecknoglobals
104+
# - gochecknoinits
105+
# - gocyclo
106+
# - godox
107+
# - gomnd
108+
# - maligned
109+
# - megacheck
110+
# - scopelint
111+
# - wsl
112+
disable-all: true
59113
enable:
114+
- bodyclose
60115
- deadcode
61116
- depguard
117+
- dogsled
62118
- dupl
63119
- errcheck
120+
- gocognit
64121
- goconst
65122
- gocritic
66123
- gofmt
67124
- goimports
68125
- golint
126+
- gosec
127+
- gosimple
128+
- govet
69129
- ineffassign
70-
- maligned
130+
- interfacer
131+
- lll
71132
- misspell
133+
- nakedret
72134
- prealloc
135+
- staticcheck
73136
- structcheck
137+
- stylecheck
74138
- typecheck
75139
- unconvert
76-
- varcheck
77-
- gosimple
78-
- govet
79-
- interfacer
80-
- staticcheck
81-
- stylecheck
82140
- unparam
83-
disable:
84-
- gochecknoglobals
85-
- gochecknoinits
86-
- gocyclo
87-
- gosec
88-
- lll
89-
- nakedret
90141
- unused
91-
fast: true
142+
- varcheck
143+
- whitespace
92144

93145
issues:
94-
exclude-use-default: false
146+
exclude-use-default: true
147+
exclude-rules:
148+
- path: _test\.go
149+
linters:
150+
- funlen
151+
- lll
152+
- errcheck
153+
- path: jsonrpc2.go
154+
linters:
155+
- gocognit
156+
text: "func `.*.Run`"
157+
- path: jsonrpc2.go
158+
linters:
159+
- deadcode
160+
- unused
161+
- varcheck
162+
text: "`requestWaiting` is unused"
163+
- path: jsonrpc2.go
164+
linters:
165+
- deadcode
166+
- unused
167+
- varcheck
168+
text: "`requestDone` is unused"
169+
- path: errors.go
170+
linters:
171+
- deadcode
172+
- unused
173+
- varcheck
174+
text: "`codeServerErrorStart` is unused"
175+
- path: errors.go
176+
linters:
177+
- deadcode
178+
- unused
179+
- varcheck
180+
text: "`codeServerErrorEnd` is unused"
95181

96182
output:
97183
format: colored-line-number

0 commit comments

Comments
 (0)