Expand description
Coverage rule: the unit suite must clear the configured floor, with test files
and the config’s exempt paths out of the denominator. Each language pairs a pure
evaluate* over a parsed report with a measure* that shells out to its tool.
Structs§
- Coverage
Report - A coverage.py JSON report (
coverage json), pared to thetotalsthe floor reads and the per-filefilesblock the diff-scoped floor reads. - File
Coverage - One
filesentry of a coverage.py report — what patch coverage reads to decide whether a changed line is covered. - Llvm
CovData - One export entry —
--summary-onlyomits everything but itstotals. - Llvm
CovMetric - One metric’s totals from an llvm-cov export.
- Llvm
CovReport - A
cargo llvm-cov --jsonexport, pared to the totals the floor reads. A single run produces onedataentry. - Llvm
CovTotals - The
totalsblock of an llvm-cov export.branchesis optional so an export from a run without branch instrumentation still parses. - Rust
Patch Coverage - Per-file region detail from a
cargo llvm-cov --jsonexport — what [crate::patch_coverage::evaluate_patch_rust] restricts to the changed lines. - Rust
Thresholds - The
cargo llvm-covcoverage floors, from a[rust].coveragetable.linesis always enforced; the rest are opt-in,Noneskipping the check. Abranchfloor adds--branch, which instruments only on a nightly toolchain. - Thresholds
- The coverage floor to enforce, from a
[<language>].coveragetable. - Totals
- The
totalsblock of a coverage.py report. - TsPatch
Coverage - Per-file detail from a vitest Istanbul report — the Istanbul maps reduced to the
tuples [
crate::patch_coverage::evaluate_patch_typescript] restricts to the diff. - Type
Script Thresholds - The four vitest coverage floors, from a
[typescript].coveragetable. - Vitest
Metric - One metric’s totals from a vitest json-summary block.
- Vitest
Report - A vitest
coverage-summary.jsonreport, pared to thetotalblock. - Vitest
Totals - The
totalblock of a vitest json-summary report — the four metrics enforced.
Enums§
- Outcome
- The result of checking a report against the thresholds.
Functions§
- evaluate
- Whether
reportmeetsthresholds. Branch coverage required but no branches measured is a misconfigured run, and fails. - evaluate_
rust - Whether
reportmeets its thresholds. A run that measured no regions at all — a wrong path, or a crate that compiled nothing — fails rather than passing vacuously. - evaluate_
typescript - Whether
reportmeets every threshold. A run that measured no code at all fails rather than passing vacuously; one metric with an empty denominator amid a non-empty run has nothing to miss and is vacuously satisfied. - measure
- Run the unit suite under coverage.py in
rootand check it againstthresholds.omitis thecoverage-rule exemptions asroot-relative paths. ThecoverageCLI, withpytestimportable, must be onPATH. - measure_
patch_ report - Run the Python unit suite with every source under
rootmeasured (--source=.), so an untested source shows infilesas wholly uncovered rather than vanishing.omitis as inmeasure. - measure_
patch_ rust_ detail - Run the Rust unit suite under
cargo llvm-covand return the per-file region detail, keyed by the absolute path llvm-cov reports.ignoreis thecoverage-rule exemptions, dropped so an exempt file’s changed lines are lifted. - measure_
patch_ typescript_ detail - Run the TypeScript unit suite under vitest and return the per-file detail for the
four metrics, keyed by the absolute path vitest reports.
excludeis thecoverage-rule exemptions, dropped so an exempt file’s changed lines are lifted. - measure_
report - Like
measure_patch_report, but measuring only the files the suite imports, exactly asmeasuredoes — the line-scoped exemption path recomputes the floor over that same file set.omitis as inmeasure. - measure_
rust - Run the unit suite under
cargo llvm-covinrootand check it againstthresholds.ignoreis thecoverage-rule exemptions asroot-relative paths;featuresthe[rust] featureslist to enable.cargo-llvm-covmust be installed. - measure_
typescript - Run the unit suite under vitest coverage in
rootand check it againstthresholds.excludeis thecoverage-rule exemptions asroot-relative paths;npxresolves the project-localvitestand@vitest/coverage-v8. - parse_
llvm_ cov_ report - Parse a
cargo llvm-cov --jsonexport. - parse_
report - Parse a coverage.py JSON report (the output of
coverage json). - parse_
vitest_ report - Parse a vitest json-summary report (
coverage-summary.json).