Commit Graph

2 Commits

Author SHA1 Message Date
Claude ac660ae282 fix(audit): scope assertion-density audit to all *_test.go by default
The script's default `find -name '*coverage*_test.go'` audited an empty
set on a clean checkout — CLAUDE.md bans `cov*_test.go` naming, so the
report had nothing to report. Post-mortem #5 flagged this.

Changes:
- New default scope: `*_test.go` (audit all test files in TARGET_DIR).
- New `--scope <pattern>` flag accepting `coverage` (legacy alias),
  `all` (explicit alias for the new default), or any glob.
- Recognize `goleak.VerifyNone` as a valid assertion form (e.g.
  measure_signal_test.go's goroutine-leak sentinel).
- Drop the `|| echo 0` fallback on `grep -c`. GNU grep prints `0` AND
  exits 1 when there are no matches, so the fallback double-printed
  ("0\n0\n") and broke the awk ratio math. Use `: ${var:=0}` instead.

Closes the post-mortem next-work item:
  "Expand audit-assertion-density.sh to cover all test files"

Tests (tests/scripts/audit-assertion-density.bats):
- default scope sees all *_test.go files
- default scope flags hollow files
- --scope coverage restricts to *coverage*_test.go
- --scope all is an explicit alias for the new default
- --check exits 1 when hollow tests are present
- --check exits 0 when no hollow tests in scope
- custom glob via --scope is honored
2026-04-26 05:40:22 +00:00
Boden Fuller 15a1e0f438 test: preserve coverage assertion hardening 2026-03-06 12:10:40 -05:00