chore: add project tooling with Makefile, golangci-lint config, and CLAUDE.md

Establish the quality infrastructure for the cburn project:

- Makefile: standardized targets for build, install, lint, test, test-race,
  bench, and fuzz. Uses explicit Go path (/usr/local/go/bin/go) for
  reproducibility. Fuzz defaults to 30s with FUZZ_TIME override.

- .golangci.yml (v2 format): enables gosec (security), revive (style),
  gocritic (bugs/perf), errcheck, nilerr, perfsprint, prealloc, and
  standard static analysis. Disables noisy rules (exported doc requirement,
  ifElseChain, deferred .Close() gosec G104). Includes gofmt + goimports
  formatters.

- CLAUDE.md: comprehensive project guide covering architecture overview,
  data flow diagram, package map, build/test commands, key design decisions
  (byte-level parsing, mtime-based caching, async TUI loading), and
  configuration reference.

- .gitignore: add pipeline.test to ignored test artifacts.
This commit is contained in:
teernisse
2026-02-19 15:41:45 -05:00
parent a04a0065a0
commit 479c250a92
4 changed files with 166 additions and 0 deletions

34
Makefile Normal file
View File

@@ -0,0 +1,34 @@
GO := /usr/local/go/bin/go
BIN := cburn
.PHONY: build install lint test test-race bench fuzz clean
## Build & install
build:
$(GO) build -o $(BIN) .
install:
$(GO) install .
## Quality
lint:
golangci-lint run ./...
test:
$(GO) test ./...
test-race:
$(GO) test -race ./...
bench:
$(GO) test -bench=. -benchmem ./internal/pipeline/
## Fuzz (run for 30s by default, override with FUZZ_TIME=2m)
FUZZ_TIME ?= 30s
fuzz:
$(GO) test -fuzz=Fuzz -fuzztime=$(FUZZ_TIME) ./internal/source/
## Housekeeping
clean:
rm -f $(BIN)
$(GO) clean -testcache