Update golangci-lint to v2.15.0 and fix the linter config
Convert .golangci.yml to the v2 layout: linters-settings and issues.exclude-use-default were rejected by the v2 schema, so the lll, funlen, cyclop, and dupl settings were never applied. Disable exhaustruct_v5 (the newer major version of the already-disabled exhaustruct) and the deprecated gomodguard. Pin the golangci-lint image at v2.15.0 in the Makefile and Dockerfile.
This commit is contained in:
+14
-12
@@ -9,24 +9,26 @@ linters:
|
||||
disable:
|
||||
# Genuinely incompatible with project patterns
|
||||
- exhaustruct # Requires all struct fields
|
||||
- exhaustruct_v5 # Same linter, newer major version (since v2.13.0)
|
||||
- depguard # Dependency allow/block lists
|
||||
- godot # Requires comments to end with periods
|
||||
- wsl # Deprecated, replaced by wsl_v5
|
||||
- gomodguard # Deprecated, replaced by gomodguard_v2
|
||||
- wrapcheck # Too verbose for internal packages
|
||||
- varnamelen # Short names like db, id are idiomatic Go
|
||||
settings:
|
||||
lll:
|
||||
line-length: 88
|
||||
funlen:
|
||||
lines: 80
|
||||
statements: 50
|
||||
cyclop:
|
||||
max-complexity: 15
|
||||
dupl:
|
||||
threshold: 100
|
||||
|
||||
linters-settings:
|
||||
lll:
|
||||
line-length: 88
|
||||
funlen:
|
||||
lines: 80
|
||||
statements: 50
|
||||
cyclop:
|
||||
max-complexity: 15
|
||||
dupl:
|
||||
threshold: 100
|
||||
|
||||
# No default exclusions: v2 applies none unless linters.exclusions.presets
|
||||
# is set, which replaces v1's exclude-use-default: false.
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
|
||||
Reference in New Issue
Block a user