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

44
.golangci.yml Normal file
View File

@@ -0,0 +1,44 @@
version: "2"
linters:
enable:
- gosec # security checks
- revive # style & correctness (golint successor)
- gocritic # bugs, performance, style
- unconvert # unnecessary type conversions
- unparam # unused function parameters
- misspell # typos in comments/strings
- errcheck # unchecked errors (on by default, being explicit)
- govet # suspicious constructs (on by default)
- staticcheck # deep static analysis (on by default)
- ineffassign # unused assignments (on by default)
- unused # unused code (on by default)
- nilerr # returning nil when error is non-nil
- perfsprint # faster fmt.Sprintf alternatives
- prealloc # slice pre-allocation hints
linters-settings:
revive:
rules:
- name: exported
disabled: true # don't require doc comments on every export
gocritic:
enabled-tags:
- diagnostic
- performance
disabled-checks:
- ifElseChain # sometimes clearer than switch
gosec:
excludes:
- G104 # don't flag deferred .Close() unchecked errors
funlen:
lines: 80
formatters:
enable:
- gofmt
- goimports
output:
sort-order:
- file