|
1 | | -# See explanation of linters at https://golangci-lint.run/usage/linters/ |
| 1 | +version: "2" |
2 | 2 | linters: |
3 | | - disable-all: true |
| 3 | + default: none |
4 | 4 | enable: |
5 | 5 | - bodyclose |
6 | 6 | - depguard |
7 | 7 | - gocritic |
8 | | - - goimports |
9 | | - - gosimple |
10 | 8 | - govet |
11 | 9 | - ineffassign |
12 | 10 | - nolintlint |
13 | 11 | - staticcheck |
14 | | - - typecheck |
15 | 12 | - unconvert |
16 | 13 | - 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 |
20 | 51 | 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