| 1 | version: "2" |
| 2 | |
| 3 | linters: |
| 4 | enable: |
| 5 | - errcheck |
| 6 | - govet |
| 7 | - ineffassign |
| 8 | - staticcheck |
| 9 | - unused |
| 10 | settings: |
| 11 | errcheck: |
| 12 | check-type-assertions: false |
| 13 | exclude-functions: |
| 14 | - (*os.File).Close |
| 15 | - (io.Closer).Close |
| 16 | - (*net/http.Response).Body.Close |
| 17 | - golang.org/x/term.Restore |
| 18 | staticcheck: |
| 19 | checks: |
| 20 | - all |
| 21 | - -ST1005 # error strings ending with punctuation — too strict for initial adoption |
| 22 | - -ST1018 # Unicode format characters — intentional in TUI code |
| 23 | - -QF1001 # De Morgan's law — readability preference |
| 24 | exclusions: |
| 25 | generated: lax |
| 26 | presets: |
| 27 | - comments |
| 28 | - common-false-positives |
| 29 | - legacy |
| 30 | - std-error-handling |
| 31 | rules: |
| 32 | # Setup/teardown in tests routinely ignores cleanup errors. |
| 33 | - path: _test\.go |
| 34 | linters: |
| 35 | - errcheck |
| 36 | # The pinned golangci-lint binary's staticcheck reports SA5011 false |
| 37 | # positives on `if x == nil { t.Fatal(...) }`-guarded derefs in tests (it |
| 38 | # doesn't treat t.Fatal as terminating); the same code is clean under a |
| 39 | # locally-built golangci-lint. Scope the suppression to tests so SA5011 |
| 40 | # still guards production code. |
| 41 | - path: _test\.go |
| 42 | linters: |
| 43 | - staticcheck |
| 44 | text: SA5011 |
| 45 | |
| 46 | issues: |
| 47 | max-issues-per-linter: 0 |
| 48 | max-same-issues: 0 |
| 49 |