Fix golangci-lint v2 config: use linters.exclusions format
Some checks failed
CI / lint (push) Failing after 31s
CI / test (push) Successful in 31s

v2 moved issues.exclude-rules to linters.exclusions.rules and
issues.exclude-dirs to linters.exclusions.paths. Enable the
std-error-handling preset for defer Close() patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-03-04 01:09:18 +01:00
parent eb14182aa3
commit 2e167f0bd1

View File

@@ -8,26 +8,21 @@ linters:
- ineffassign
- staticcheck
- unused
issues:
exclude-dirs:
- cmd/panel
- cmd/icongen
exclude-rules:
# defer body.Close() — safe pattern, return value is irrelevant
- linters: [errcheck]
source: "defer .+\\.Close\\(\\)"
# resp.Body.Close in non-defer context (checked via HTTP status already)
- linters: [errcheck]
source: "\\.Body\\.Close\\(\\)"
# systray menu.ShowMenu has no meaningful error
- linters: [errcheck]
path: internal/tray/
source: "ShowMenu"
# binary.Write in ICO header encoding — panic-level errors only
- linters: [errcheck]
path: internal/icons/render\.go
source: "binary\\.Write"
# Setup binary is a CLI wizard; best-effort error handling is acceptable
- linters: [errcheck, gosec]
path: cmd/setup/
exclusions:
presets:
- std-error-handling
rules:
# binary.Write in ICO header encoding — panic-level errors only
- path: internal/icons/render\.go
linters: [errcheck]
source: "binary\\.Write"
# systray menu.ShowMenu has no meaningful error
- path: internal/tray/
linters: [errcheck]
source: "ShowMenu"
# Setup binary is a CLI wizard; best-effort error handling is acceptable
- path: cmd/setup/
linters: [errcheck, gosec]
paths:
- cmd/panel
- cmd/icongen