chore: add Makefile with check gate, golangci-lint config, dockerignore

- make check runs lint + vet + test-short; lint is pinned to the go.mod
  toolchain so it works when the host Go is newer than golangci-lint's
- gofumpt main.go and patch.go; drop unused gatewayGroup/gatewayKind vars

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 20:32:53 +02:00
co-authored by Claude Opus 5.5
parent 2be69b9aac
commit 0eb588e8bd
7 changed files with 122 additions and 13 deletions
@@ -5,7 +5,7 @@ Plan: `docs/plans/2026-10-08-2028-house-conventions.md`
- [x] Step 0 — Save and commit the plan
- [x] Step 1 — CLAUDE.md
- [x] Step 2 — `.claude/` and docs scaffolding
- [ ] Step 3 — Makefile, lint, formatting
- [x] Step 3 — Makefile, lint, formatting
- [ ] Step 4 — Module path and version identity
- [ ] Step 5 — Baseline tests
- [ ] Step 6 — CI build workflow
@@ -51,3 +51,36 @@ Worth noting: `.claude/settings.json` leaves out `git commit`, `git push` and
`git tag` on purpose, but `~/.claude/settings.json` allows `git commit` and
`git push` globally, so on this machine the push confirmation rests on CLAUDE.md,
not on the permission system.
## Step 3 — Makefile, lint, formatting
Added `Makefile` (uh-cli's shape plus `run`, `docker-build` and `-race` on `test`),
`.golangci.yml` (v2 defaults) and `.dockerignore` (egress's allowlist).
`make lint` failed on first run, before reaching this repo's code:
```
$ golangci-lint run ./...
.../go/1.27.1/libexec/src/crypto/internal/randutil/randutil.go:11:2: could not import math/rand/v2
(.../math/rand/v2/rand.go:213:17: method must have no type parameters) (typecheck)
```
The installed golangci-lint 2.12.2 was built with go1.26.4 and cannot type-check the
Go 1.27 standard library. The `lint` target now runs under the go.mod toolchain,
which is also what CI uses:
```make
GO_MOD_VERSION := $(shell awk '$$1 == "go" {print $$2}' go.mod)
lint:
GOTOOLCHAIN=go$(GO_MOD_VERSION) golangci-lint run ./...
```
With that, lint reported the two expected dead variables (`gatewayGroup`,
`gatewayKind` in `patch.go`), which were removed. `make fmt` reformatted `main.go`
(import order) and the `patch.go` var block.
Worth noting: this is likely the same failure the egress changelog records as
"`make lint` is blocked by a Go 1.27 toolchain/staticcheck panic"; the same
`GOTOOLCHAIN` pin should unblock it there. Rebuilding golangci-lint with Go 1.27 is
the other fix. `.golangci.yml` carries no settings yet: uh-cli's `errcheck`
exclusions are CLI-specific and nothing here needed one.