|
3 | 3 | run: |
4 | 4 | timeout: 20m |
5 | 5 | tests: true |
6 | | - # default is true. Enables skipping of directories: |
7 | | - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
8 | | - skip-dirs-use-default: true |
9 | | - skip-files: |
10 | | - - core/genesis_alloc.go |
11 | 6 |
|
12 | 7 | linters: |
13 | | - disable-all: true |
14 | 8 | enable: |
| 9 | + # Every available linter at the time of writing was considered (quickly) and |
| 10 | + # inclusion was liberal. Linters are good at detecting code smells, but if |
| 11 | + # we find that a particular one causes too many false positives then we can |
| 12 | + # configure it better or, as a last resort, remove it. |
| 13 | + - containedctx |
| 14 | + - errcheck |
| 15 | + - forcetypeassert |
| 16 | + - gci |
| 17 | + - gocheckcompilerdirectives |
| 18 | + - gofmt |
15 | 19 | - goimports |
16 | | - - gosimple |
| 20 | + - gomodguard |
| 21 | + - gosec |
17 | 22 | - govet |
18 | 23 | - ineffassign |
| 24 | + # TODO(arr4n): investigate ireturn |
19 | 25 | - misspell |
| 26 | + - nakedret |
| 27 | + - nestif |
| 28 | + - nilerr |
| 29 | + - nolintlint |
| 30 | + - reassign |
| 31 | + - revive |
| 32 | + - sloglint |
| 33 | + - staticcheck |
| 34 | + - tagliatelle |
| 35 | + - testableexamples |
| 36 | + - testifylint |
| 37 | + - thelper |
| 38 | + - tparallel |
20 | 39 | - unconvert |
21 | | - - typecheck |
| 40 | + - usestdlibvars |
22 | 41 | - unused |
23 | | - - staticcheck |
24 | | - - bidichk |
25 | | - - durationcheck |
26 | | - - exportloopref |
27 | 42 | - whitespace |
28 | 43 |
|
29 | | - # - structcheck # lots of false positives |
30 | | - # - errcheck #lot of false positives |
31 | | - # - contextcheck |
32 | | - # - errchkjson # lots of false positives |
33 | | - # - errorlint # this check crashes |
34 | | - # - exhaustive # silly check |
35 | | - # - makezero # false positives |
36 | | - # - nilerr # several intentional |
37 | | - |
38 | 44 | linters-settings: |
39 | | - gofmt: |
40 | | - simplify: true |
| 45 | + gci: |
| 46 | + custom-order: true |
| 47 | + sections: |
| 48 | + - standard |
| 49 | + - default |
| 50 | + - localmodule |
| 51 | + # The rest of these break developer expections, in increasing order of |
| 52 | + # divergence, so are at the end to increase the chance of being seen. |
| 53 | + - alias |
| 54 | + - dot |
| 55 | + - blank |
| 56 | + gomodguard: |
| 57 | + blocked: |
| 58 | + modules: |
| 59 | + - github.com/ava-labs/avalanchego: |
| 60 | + - github.com/ava-labs/coreth: |
| 61 | + - github.com/ava-labs/subnet-evm: |
| 62 | + revive: |
| 63 | + rules: |
| 64 | + - name: unused-parameter |
| 65 | + # Method parameters may be equired by interfaces and forcing them to be |
| 66 | + # named _ is of questionable benefit. |
| 67 | + disabled: true |
41 | 68 |
|
42 | 69 | issues: |
43 | | - exclude-rules: |
44 | | - - path: crypto/bn256/cloudflare/optate.go |
| 70 | + exclude-dirs-use-default: false |
| 71 | + exclude-rules: |
| 72 | + - path-except: libevm |
45 | 73 | linters: |
46 | | - - deadcode |
| 74 | + # If any issue is flagged in a non-libevm file, add the linter here |
| 75 | + # because the problem isn't under our control. |
| 76 | + - containedctx |
| 77 | + - forcetypeassert |
| 78 | + - errcheck |
| 79 | + - gci |
| 80 | + - gofmt |
| 81 | + - gosec |
| 82 | + - gosimple |
| 83 | + - govet |
| 84 | + - nakedret |
| 85 | + - nestif |
| 86 | + - nilerr |
| 87 | + - nolintlint |
| 88 | + - revive |
47 | 89 | - staticcheck |
48 | | - - path: internal/build/pgp.go |
49 | | - text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.' |
50 | | - - path: core/vm/contracts.go |
51 | | - text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.' |
52 | | - - path: accounts/usbwallet/trezor.go |
53 | | - text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.' |
54 | | - - path: accounts/usbwallet/trezor/ |
55 | | - text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.' |
56 | | - exclude: |
57 | | - - 'SA1019: event.TypeMux is deprecated: use Feed' |
58 | | - - 'SA1019: strings.Title is deprecated' |
59 | | - - 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.' |
60 | | - - 'SA1029: should not use built-in type string as key for value' |
| 90 | + - tagliatelle |
| 91 | + - testableexamples |
| 92 | + - testifylint |
| 93 | + - thelper |
| 94 | + - tparallel |
| 95 | + - usestdlibvars |
| 96 | + - varnamelen |
| 97 | + - wastedassign |
| 98 | + - whitespace |
| 99 | + include: |
| 100 | + # Many of the default exclusions are because, verbatim "Annoying issue", |
| 101 | + # which defeats the point of a linter. |
| 102 | + - EXC0002 |
| 103 | + - EXC0004 |
| 104 | + - EXC0005 |
| 105 | + - EXC0006 |
| 106 | + - EXC0007 |
| 107 | + - EXC0008 |
| 108 | + - EXC0009 |
| 109 | + - EXC0010 |
| 110 | + - EXC0011 |
| 111 | + - EXC0012 |
| 112 | + - EXC0013 |
| 113 | + - EXC0014 |
| 114 | + - EXC0015 |
0 commit comments