项目文件夹

文件
2026-07-13 13:00:08 +08:00

49 行
1.3 KiB
YAML

version: "2"
linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
settings:
errcheck:
check-type-assertions: false
exclude-functions:
- (*os.File).Close
- (io.Closer).Close
- (*net/http.Response).Body.Close
- golang.org/x/term.Restore
staticcheck:
checks:
- all
- -ST1005 # error strings ending with punctuation — too strict for initial adoption
- -ST1018 # Unicode format characters — intentional in TUI code
- -QF1001 # De Morgan's law — readability preference
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Setup/teardown in tests routinely ignores cleanup errors.
- path: _test\.go
linters:
- errcheck
# The pinned golangci-lint binary's staticcheck reports SA5011 false
# positives on `if x == nil { t.Fatal(...) }`-guarded derefs in tests (it
# doesn't treat t.Fatal as terminating); the same code is clean under a
# locally-built golangci-lint. Scope the suppression to tests so SA5011
# still guards production code.
- path: _test\.go
linters:
- staticcheck
text: SA5011
issues:
max-issues-per-linter: 0
max-same-issues: 0