Skip to content

Commit 5b8f65a

Browse files
committed
Run golangci-lint migrate to support v2 syntax
1 parent f378fc9 commit 5b8f65a

File tree

1 file changed

+55
-47
lines changed

1 file changed

+55
-47
lines changed

.golangci.yml

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
1-
# See explanation of linters at https://golangci-lint.run/usage/linters/
1+
version: "2"
22
linters:
3-
disable-all: true
3+
default: none
44
enable:
55
- bodyclose
66
- depguard
77
- gocritic
8-
- goimports
9-
- gosimple
108
- govet
119
- ineffassign
1210
- nolintlint
1311
- staticcheck
14-
- typecheck
1512
- unconvert
1613
- unused
17-
18-
linters-settings:
19-
depguard:
14+
settings:
15+
depguard:
16+
rules:
17+
main:
18+
deny:
19+
- pkg: errors
20+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
21+
- pkg: github.com/pkg/errors
22+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
23+
- pkg: github.com/cockroachdb/errors
24+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
25+
- pkg: github.com/hashicorp/go-multierror
26+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
27+
- pkg: io/ioutil
28+
desc: The ioutil package has been deprecated
29+
forbidigo:
30+
forbid:
31+
- pattern: fmt\.Errorf
32+
gocritic:
33+
disabled-checks:
34+
- appendAssign
35+
- assignOp
36+
- commentFormatting
37+
- deprecatedComment
38+
- exitAfterDefer
39+
- ifElseChain
40+
- singleCaseSwitch
41+
govet:
42+
disable:
43+
- composites
44+
exclusions:
45+
generated: lax
46+
presets:
47+
- comments
48+
- common-false-positives
49+
- legacy
50+
- std-error-handling
2051
rules:
21-
main:
22-
deny:
23-
- pkg: "errors"
24-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
25-
- pkg: "github.com/pkg/errors"
26-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
27-
- pkg: "github.com/cockroachdb/errors"
28-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
29-
- pkg: "github.com/hashicorp/go-multierror"
30-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
31-
- pkg: "io/ioutil"
32-
desc: "The ioutil package has been deprecated"
33-
gocritic:
34-
disabled-checks:
35-
- appendAssign # Too many false positives
36-
- assignOp # Maybe worth adding, but likely not worth the noise
37-
- commentFormatting # No strong benefit
38-
- deprecatedComment # Unnecessary
39-
- exitAfterDefer # Only occurs in auxiliary tools
40-
- ifElseChain # Noisy for not much gain
41-
- singleCaseSwitch # Noisy for not much gain
42-
govet:
43-
disable:
44-
- composites
45-
forbidigo:
46-
forbid:
47-
# Use errors.New instead
48-
- 'fmt\.Errorf'
49-
50-
issues:
51-
exclude-rules:
52-
# Exclude bodyclose lint from tests because leaking connections in tests
53-
# is a non-issue, and checking that adds unnecessary noise
54-
- path: _test\.go
55-
linters:
56-
- bodyclose
57-
58-
run:
59-
timeout: 5m
52+
- linters:
53+
- bodyclose
54+
path: _test\.go
55+
paths:
56+
- third_party$
57+
- builtin$
58+
- examples$
59+
formatters:
60+
enable:
61+
- goimports
62+
exclusions:
63+
generated: lax
64+
paths:
65+
- third_party$
66+
- builtin$
67+
- examples$

0 commit comments

Comments
 (0)