Skip to content

Commit 2e83a5e

Browse files
committed
lint/golangci: update .golangci.yml
1 parent 2fbed0a commit 2e83a5e

File tree

1 file changed

+50
-58
lines changed

1 file changed

+50
-58
lines changed

.golangci.yml

Lines changed: 50 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
11
run:
2+
timeout: 1m
23
issues-exit-code: 1
34
tests: true
4-
skip-dirs:
5-
- "vendor$"
5+
skip-dirs: []
6+
skip-dirs-use-default: true
67
skip-files:
78
- ".*\\.pb\\.go"
89
- ".*(.|_)gen\\.go"
9-
modules-download-mode: readonly
10+
modules-download-mode: vendor
11+
allow-parallel-runners: true
12+
13+
output:
14+
format: colored-line-number
15+
print-issued-lines: true
16+
print-linter-name: true
1017

1118
linters-settings:
1219
dupl:
13-
threshold: 400
20+
threshold: 100
1421
errcheck:
1522
check-type-assertions: true
1623
check-blank: true
1724
exclude: .errcheckignore
1825
funlen:
1926
lines: 80
20-
statements: 40
27+
statements: 80
28+
gocognit:
29+
min-complexity: 10
2130
goconst:
2231
min-len: 3
2332
min-occurrences: 3
2433
gocritic:
2534
enabled-tags:
2635
- diagnostic
36+
- style
37+
- performance
2738
- experimental
2839
- opinionated
29-
- performance
30-
- style
3140
settings:
3241
hugeParam:
3342
sizeThreshold: 80
@@ -36,50 +45,19 @@ linters-settings:
3645
rangeValCopy:
3746
sizeThreshold: 128
3847
gocyclo:
39-
min-complexity: 10
48+
min-complexity: 15
4049
gofmt:
4150
simplify: true
4251
goimports:
4352
local-prefixes: go.lsp.dev/jsonrpc2
4453
golint:
4554
min-confidence: 0.3
4655
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
56+
enable-all: true
7957
disable:
80-
- shadow
58+
- shadow
8159
lll:
82-
line-length: 180
60+
line-length: 120
8361
tab-width: 1
8462
maligned:
8563
suggest-new: false
@@ -90,48 +68,59 @@ linters-settings:
9068
prealloc:
9169
simple: true
9270
range-loops: true
93-
for-loops: false
71+
for-loops: true # default: false
9472
unparam:
95-
algo: cha
9673
check-exported: true
74+
algo: cha
9775
unused:
9876
check-exported: false
77+
whitespace:
78+
multi-if: true
79+
multi-func: true
9980

10081
linters:
101-
# disabled:
102-
# - funlen
82+
disable-all: true
83+
disabled:
84+
# - asciicheck
10385
# - gochecknoglobals
10486
# - gochecknoinits
105-
# - gocyclo
10687
# - godox
88+
# - goerr113
10789
# - gomnd
90+
# - gosec
10891
# - maligned
109-
# - megacheck
11092
# - scopelint
93+
# - testpackage
11194
# - wsl
112-
disable-all: true
11395
enable:
11496
- bodyclose
11597
- deadcode
11698
- depguard
11799
- dogsled
118100
- dupl
119101
- errcheck
102+
- exhaustive
103+
- funlen
120104
- gocognit
121105
- goconst
122106
- gocritic
107+
- gocyclo
108+
- godot
123109
- gofmt
124110
- goimports
125111
- golint
126-
- gosec
112+
- goprintffuncname
127113
- gosimple
128114
- govet
129115
- ineffassign
130116
- interfacer
131-
- lll
132117
- misspell
133118
- nakedret
119+
- noctx
120+
- nestif
134121
- prealloc
122+
- nolintlint
123+
- rowserrcheck
135124
- staticcheck
136125
- structcheck
137126
- stylecheck
@@ -166,20 +155,23 @@ issues:
166155
- unused
167156
- varcheck
168157
text: "`reqDone` is unused"
169-
- path: errors.go
158+
- path: codes.go
170159
linters:
171160
- deadcode
172161
- unused
173162
- varcheck
174163
text: "`codeServerErrorStart` is unused"
175-
- path: errors.go
164+
- path: codes.go
176165
linters:
177166
- deadcode
178167
- unused
179168
- varcheck
180169
text: "`codeServerErrorEnd` is unused"
181-
182-
output:
183-
format: colored-line-number
184-
print-issued-lines: true
185-
print-linter-name: true
170+
- path: jsonrpc2.go
171+
linters:
172+
- funlen
173+
- gocyclo
174+
- gocognit
175+
- path: stream.go
176+
linters:
177+
- gocognit

0 commit comments

Comments
 (0)