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:26:35 +01:00
parent af19b6a798
commit 98e9a2d59c
+18 -16
View File
@@ -1,4 +1,14 @@
linters-settings: version: "2"
linters:
enable:
- errcheck
- gosec
- govet
- staticcheck
- unused
- ineffassign
settings:
govet: govet:
enable: enable:
- fieldalignment - fieldalignment
@@ -8,28 +18,20 @@ linters-settings:
- (io.Closer).Close - (io.Closer).Close
- (*encoding/json.Encoder).Encode - (*encoding/json.Encoder).Encode
- (io.Writer).Write - (io.Writer).Write
exclusions:
linters: paths:
enable:
- errcheck
- gosec
- govet
- gofmt
- staticcheck
- unused
- ineffassign
- typecheck
issues:
exclude-dirs:
- vendor - vendor
# Exclude some linters from running on test files # Exclude some linters from running on test files
exclude-rules: rules:
- path: _test\.go - path: _test\.go
linters: linters:
- errcheck - errcheck
- gosec - gosec
formatters:
enable:
- gofmt
run: run:
timeout: 5m timeout: 5m
tests: true tests: true