Files
cthulhu/.golangci.yml
T

68 lines
2.2 KiB
YAML

version: "2"
run:
# The Braille helper lives behind a build tag; without listing it here those
# files are silently never analyzed. Analyzing with it needs the same
# development libraries as the Arch PKGBUILD (at-spi2, gtk3, brltty,
# liblouis).
#
# The optional DuckDB debug-log sink is deliberately not listed, so this gate
# does not require DuckDB headers. When changing that feature, lint it with:
# golangci-lint run --build-tags duckdb ./...
build-tags:
- brlapi
timeout: 5m
linters:
default: standard
enable:
- bodyclose
- errorlint
- misspell
settings:
staticcheck:
# Bug (SA) and simplification (S) checks only. ST style checks
# conflict with deliberate complete, capitalized user-facing
# messages, and QF quickfixes are optional rewrites; neither should
# gate contributions. S1005 conflicts with errcheck: receiving an
# error result purely for synchronization is discarded explicitly
# with _ = <-ch rather than silently.
checks:
- all
- -ST*
- -QF*
- -S1005
errcheck:
exclude-functions:
# CLI usage/status output: there is nothing useful to do if writing
# the message itself fails.
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
exclusions:
rules:
# Close on cleanup paths (pipe ends after spawning helpers,
# connections and files being discarded) is best-effort teardown
# with no actionable recovery. Closes whose errors protect data
# (flushing writers, saved configuration, the debug database)
# are handled explicitly at those call sites and must stay handled.
- text: 'Error return value of `[^`]+\.Close` is not checked'
linters:
- errcheck
# Tests routinely ignore fixture teardown errors, and assert exact
# sentinel identity on errors they constructed unwrapped.
# Production code must still handle errors or discard them
# explicitly with _ =.
- path: _test\.go
linters:
- errcheck
- errorlint
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt