Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
repos:
- repo: https://github.com/golangci/golangci-lint.git
rev: v2.12.0
hooks:
- id: golangci-lint
args: [--fix]
- repo: local
hooks:
# Uses the golangci-lint on PATH rather than the upstream pre-commit
# repo, which builds the linter from source with whatever Go it finds.
# A linter built with Go < 1.26 refuses to load this config ("the Go
# language version used to build golangci-lint is lower than the
# targeted Go version"). Install the matching binary with:
# go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.0
- id: golangci-lint
name: golangci-lint
entry: golangci-lint run --fix
language: system
types: [go]
pass_filenames: false
require_serial: true
- id: go-test
name: go test
entry: go test ./...
Expand Down
8 changes: 7 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ pre-commit run --all-files # lint+test against the whole tree
~/go/bin/golangci-lint run # lint without pre-commit (needs v2.12+)
```

`pre-commit install` was already run in this clone — every commit runs golangci-lint (with `--fix`) and `go test ./...`. The hooks pin golangci-lint v2.12.0; CI pins the same version through `golangci/golangci-lint-action@v7`.
`pre-commit install` was already run in this clone — every commit runs golangci-lint (with `--fix`) and `go test ./...`. The lint hook shells out to the `golangci-lint` on `PATH` instead of the upstream pre-commit repo, which builds the linter from source with whatever Go it finds; a linter built with Go < 1.26 refuses to load this config. Install the matching binary once:

```bash
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.0
```

CI pins the same version through `golangci/golangci-lint-action@v7`.

## Architecture

Expand Down
Loading