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
13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ linters:
# deferred response-body closes
- (io.ReadCloser).Close

# Formatting is a gate, not a convention. Nothing enforced gofmt before this,
# so six files had drifted unnoticed (#329) — `golangci-lint run` now reports a
# diff as an issue, which fails both `make lint` and the CI lint job.
# Run `make fmt` (golangci-lint fmt) to apply the fixes.
formatters:
enable:
- gofmt
exclusions:
# internal/api/gen/generated.go is written by genqlient; a formatting
# complaint there is not actionable by hand, since `make generate`
# rewrites it.
generated: strict

issues:
max-issues-per-linter: 0
max-same-issues: 0
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ don't batch to end-of-session.
```sh
make build # version-stamped binary at bin/hadron (ldflags from `git describe`)
make test # go test ./...
make lint # golangci-lint run
make lint # golangci-lint run (gofmt is gated here — a diff fails the build)
make fmt # golangci-lint fmt — apply the formatting `make lint` gates on
make generate # regenerate genqlient code from the committed schema snapshot
make schema # re-export the schema from ../hadron-server, then generate
make schema-check # fail if the committed snapshot is stale vs ../hadron-server (drift detector)
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ HADRON_SERVER_DIR ?= ../hadron-server
# (typeDefs.ts is a self-contained SDL string, so those are the only deps).
SDL_EXPORT ?= pnpm -s tsx scripts/export-graphql-sdl.mjs

.PHONY: build test lint generate schema schema-check tools-manifest tools-manifest-check clean
.PHONY: build test lint fmt generate schema schema-check tools-manifest tools-manifest-check clean

build:
go build -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/hadron
Expand All @@ -26,6 +26,10 @@ test:
lint:
golangci-lint run

# Apply the formatting `make lint` gates on (gofmt, per .golangci.yml).
fmt:
golangci-lint fmt

# Regenerate genqlient code from the committed schema snapshot.
generate:
go tool genqlient
Expand Down