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.
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
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
|