diff options
| author | Christian Cleberg <[email protected]> | 2026-07-15 02:23:40 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-15 02:23:40 -0500 |
| commit | 672ff7f44b0061e179fb33c16418738d6455a4e9 (patch) | |
| tree | 7e7c42ccb58b20a8fd04c6cdecfc20303110989f | |
| parent | b1ad14553277d9d72a5e4b4462a52a2e2d0fdbb1 (diff) | |
| download | skunky-art-672ff7f44b0061e179fb33c16418738d6455a4e9.tar.gz skunky-art-672ff7f44b0061e179fb33c16418738d6455a4e9.tar.bz2 skunky-art-672ff7f44b0061e179fb33c16418738d6455a4e9.zip | |
build: add golangci-lint configuration
Enables the standard linters plus revive's exported rule, a set of
correctness/security linters (bodyclose, noctx, gosec, forcetypeassert,
canonicalheader, musttag, predeclared, exhaustive), modernization
linters, and staticcheck's full check set including the doc-comment and
naming checks that are off by default.
The idiom-fighting linters stay off: varnamelen objects to short names
that are idiomatic Go, exhaustruct demands every field be initialized,
gochecknoglobals flags CFG/Host which are deliberate, and tagliatelle
would rename JSON config keys and break existing instances' configs.
| -rw-r--r-- | .golangci.yml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..32883a8 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,48 @@ +version: "2" + +linters: + # standard = govet, errcheck, staticcheck, ineffassign, unused + default: standard + enable: + # Correctness / security + - bodyclose + - noctx + - gosec + - forcetypeassert + - canonicalheader + - musttag + - predeclared + - exhaustive + # Modernization + - modernize + - gocritic + - mirror + - perfsprint + - intrange + # Docs and style + - revive + - godot + + settings: + revive: + rules: + # Requires a doc comment on every exported symbol, starting with the + # symbol's own name. checkPrivateReceivers extends this to exported + # methods on unexported types, which is most of the app package. + - name: exported + arguments: + - checkPrivateReceivers + staticcheck: + # "all" turns on the doc-comment checks (ST1000/ST1020/ST1021/ST1022) and + # the naming checks (ST1003), which are off by default. + checks: + - all + + exclusions: + rules: + # Test helpers make throwaway requests to a local httptest server; a + # context and a closed body add noise without catching anything. + - path: _test\.go$ + linters: + - bodyclose + - noctx |
