|
| 1 | +version: "2" |
| 2 | + |
| 3 | +run: |
| 4 | + timeout: 10m |
| 5 | + |
| 6 | +issues: |
| 7 | + max-issues-per-linter: 0 |
| 8 | + max-same-issues: 0 |
| 9 | + |
| 10 | +linters: |
| 11 | + default: none |
| 12 | + enable: |
| 13 | + - errcheck |
| 14 | + - govet |
| 15 | + - ineffassign |
| 16 | + - staticcheck |
| 17 | + - unused |
| 18 | + - errorlint |
| 19 | + - misspell |
| 20 | + settings: |
| 21 | + errcheck: |
| 22 | + check-type-assertions: false |
| 23 | + check-blank: false |
| 24 | + exclude-functions: |
| 25 | + - (io.Closer).Close |
| 26 | + - (*os.File).Close |
| 27 | + - (net.Listener).Close |
| 28 | + - (*net.TCPConn).Close |
| 29 | + - (*net.UDPConn).Close |
| 30 | + - (*bytes.Buffer).WriteString |
| 31 | + - (*bytes.Buffer).WriteByte |
| 32 | + - (*bytes.Buffer).Write |
| 33 | + - (*strings.Builder).WriteString |
| 34 | + - (*strings.Builder).WriteByte |
| 35 | + - (*strings.Builder).WriteRune |
| 36 | + - (*strings.Builder).Write |
| 37 | + - (*go.uber.org/zap/buffer.Buffer).Write |
| 38 | + - (*github.com/gorilla/websocket.Conn).SetReadDeadline |
| 39 | + - (*github.com/gorilla/websocket.Conn).SetWriteDeadline |
| 40 | + - fmt.Fprint |
| 41 | + - fmt.Fprintln |
| 42 | + - fmt.Fprintf |
| 43 | + - github.com/gagliardetto/binary.EncodeCompactU16Length |
| 44 | + errorlint: |
| 45 | + errorf: true |
| 46 | + asserts: true |
| 47 | + comparison: true |
| 48 | + staticcheck: |
| 49 | + checks: |
| 50 | + - all |
| 51 | + # Known follow-ups — tracked separately, not in scope for the lint rollout: |
| 52 | + - -SA1019 # deprecated API usage (logging package, ssh/terminal -> x/term, cloudkms.New) |
| 53 | + - -ST1001 # dot imports (text/format, zap-box) — refactor-scale change |
| 54 | + - -ST1003 # underscore naming in exported consts/params — breaking API change |
| 55 | + - -ST1016 # receiver name consistency — ws pkg mixes "c"/"cl", refactor-scale |
| 56 | + - -ST1019 # duplicate imports (same files) |
| 57 | + - -QF1008 # could remove embedded field selector — stylistic, keep for legibility |
| 58 | + - -SA9003 # empty branches — scaffolding in rpc/ws/examples/ |
| 59 | + misspell: |
| 60 | + locale: US |
| 61 | + exclusions: |
| 62 | + generated: lax |
| 63 | + presets: |
| 64 | + - comments |
| 65 | + - common-false-positives |
| 66 | + - legacy |
| 67 | + - std-error-handling |
| 68 | + rules: |
| 69 | + # Test files: allow unchecked errors and legacy error comparisons. |
| 70 | + - path: _test\.go |
| 71 | + linters: |
| 72 | + - errcheck |
| 73 | + - errorlint |
| 74 | + # CLI / cmd binaries: unchecked errors on stdout prints are fine. |
| 75 | + - path: cmd/ |
| 76 | + linters: |
| 77 | + - errcheck |
| 78 | + - path: cli/ |
| 79 | + linters: |
| 80 | + - errcheck |
| 81 | + # WS subscription examples are demo code using `if false {}` to show |
| 82 | + # multiple patterns side by side. Exclude from lint. |
| 83 | + - path: rpc/ws/examples/ |
| 84 | + linters: |
| 85 | + - govet |
| 86 | + - staticcheck |
| 87 | + # Unused identifiers that are either intentionally kept (lookup tables |
| 88 | + # reserved for future work, logging-side-effect registrations) or live |
| 89 | + # in code paths pending refactor. Tracked as follow-up. |
| 90 | + - path: base58/tables\.go |
| 91 | + linters: |
| 92 | + - unused |
| 93 | + - path: logging\.go |
| 94 | + linters: |
| 95 | + - unused |
| 96 | + - path: diff/ |
| 97 | + linters: |
| 98 | + - unused |
| 99 | + - staticcheck |
| 100 | + - path: text/encoder\.go |
| 101 | + linters: |
| 102 | + - staticcheck |
| 103 | + - path: zap-box/ |
| 104 | + linters: |
| 105 | + - unused |
| 106 | + - path: programs/token(-2022)?/json\.go |
| 107 | + linters: |
| 108 | + - unused |
| 109 | + - path: rpc/client\.go |
| 110 | + linters: |
| 111 | + - unused |
| 112 | + - path: rpc/ws/client\.go |
| 113 | + linters: |
| 114 | + - unused |
| 115 | + |
| 116 | +formatters: |
| 117 | + enable: |
| 118 | + - gofmt |
| 119 | + - goimports |
| 120 | + exclusions: |
| 121 | + generated: lax |
0 commit comments