Fix golangci-lint v2 config: use linters.exclusions format
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:
@@ -8,26 +8,21 @@ linters:
|
|||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- unused
|
- unused
|
||||||
|
exclusions:
|
||||||
issues:
|
presets:
|
||||||
exclude-dirs:
|
- 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/panel
|
||||||
- cmd/icongen
|
- 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/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user