Skip to content

fix(tooling): restore Fallow function coverage#255

Merged
DavidBabinec merged 1 commit into
mainfrom
fix/fallow-function-coverage
Jul 24, 2026
Merged

fix(tooling): restore Fallow function coverage#255
DavidBabinec merged 1 commit into
mainfrom
fix/fallow-function-coverage

Conversation

@DavidBabinec

Copy link
Copy Markdown
Contributor

What changed

  • derive Istanbul fnMap/f entries from the TypeScript source AST when Bun LCOV omits per-function FN/FNDA records
  • preserve native LCOV function records when another producer supplies them
  • retain Bun DA statement/line coverage and emit full source ranges for inferred functions
  • make the converter import-safe and add focused regression tests for native records, AST fallback, hit counts, ranges, and statement coverage

Why

Bun writes FNF/FNH aggregate totals and DA line hits, but no individual function records. The previous converter therefore generated 0 functions, so Fallow matched 0 of 28,000+ analyzed functions and fell back to estimated coverage for every CRAP score.

Impact

A fresh run now emits 12,966 Istanbul functions across 1,524 covered files. Fallow 3.9.1 directly matches 9,619 analyzed source functions instead of 0; files absent from Bun coverage continue to use Fallow's normal estimate.

Verification

  • bun test scripts/lcov-to-istanbul.test.ts (3 pass)
  • bun run test:coverage (6,257 pass; converter emitted 1,524 files / 12,966 functions)
  • npx fallow health --coverage .coverage/coverage-final.json --format json --quiet --top 1 (coverage_model: istanbul, istanbul_matched: 9619)
  • bun run lint
  • bun run build

@DavidBabinec
DavidBabinec marked this pull request as ready for review July 24, 2026 13:53
@DavidBabinec
DavidBabinec merged commit f756644 into main Jul 24, 2026
9 checks passed
@DavidBabinec
DavidBabinec deleted the fix/fallow-function-coverage branch July 24, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant