lint: align local gofumpt rules with golangci-lint v2.5.0

Bumping CI to v2.5.0 surfaced two new gofumpt findings (in two test
files that gofumpt v2.1.6 considered fine). Local re-format with
the matching tool brings them in line.

Pre-commit hook config: prepend $GOPATH/bin to PATH inside the hook
entry so gofumpt + golangci-lint resolve when ~/go/bin isn't on the
operator's interactive shell PATH (common — go install puts them
there but PATH config varies). Without this, the hooks fail with
'Executable not found' even when the tools are installed.

Pin the Makefile setup target to v2.5.0 so a fresh clone gets the
same binary CI runs — keeps pre-commit and CI from drifting again.
This commit is contained in:
2026-05-03 21:31:47 +01:00
parent d9c8da139c
commit 380931b3a8
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ repos:
- id: gofumpt
name: gofumpt
description: Format Go files with gofumpt (stricter superset of gofmt)
entry: gofumpt -l -w
entry: bash -c 'PATH="$(go env GOPATH)/bin:$PATH" exec gofumpt -l -w "$@"' --
language: system
types: [go]
pass_filenames: true
@@ -42,7 +42,7 @@ repos:
- id: golangci-lint
name: golangci-lint
description: Run golangci-lint against the whole module (matches CI)
entry: golangci-lint run ./...
entry: bash -c 'PATH="$(go env GOPATH)/bin:$PATH" exec golangci-lint run ./...'
language: system
types: [go]
pass_filenames: false