build(lint): migrate golangci-lint config to v2 schema

Installed golangci-lint v2 rejected the v1 config (unsupported version), silently disabling the lint gate. Migrate to v2 (version, formatters section, linters.exclusions) preserving the same linter selection so the gate runs again.
This commit is contained in:
2026-06-19 14:01:42 +01:00
parent af19b6a798
commit 98e9a2d59c
+23 -21
View File
@@ -1,34 +1,36 @@
linters-settings:
govet:
enable:
- fieldalignment
errcheck:
# Ignore error checks in test files for common test helpers
exclude-functions:
- (io.Closer).Close
- (*encoding/json.Encoder).Encode
- (io.Writer).Write
version: "2"
linters:
enable:
- errcheck
- gosec
- govet
- gofmt
- staticcheck
- unused
- ineffassign
- typecheck
settings:
govet:
enable:
- fieldalignment
errcheck:
# Ignore error checks in test files for common test helpers
exclude-functions:
- (io.Closer).Close
- (*encoding/json.Encoder).Encode
- (io.Writer).Write
exclusions:
paths:
- vendor
# Exclude some linters from running on test files
rules:
- path: _test\.go
linters:
- errcheck
- gosec
issues:
exclude-dirs:
- vendor
# Exclude some linters from running on test files
exclude-rules:
- path: _test\.go
linters:
- errcheck
- gosec
formatters:
enable:
- gofmt
run:
timeout: 5m