Skip to main content

Module patch_coverage

Module patch_coverage 

Source
Expand description

Diff-scoped coverage floor: the thresholds unit coverage enforces whole-tree, measured over only the lines <base>...HEAD added or modified. Each language pairs a measure* that shells out to its tool with a pure evaluate_patch* over the diff.

Functions§

changed_lines
The new-side lines each file gained in repo’s <base>...HEAD merge-base diff, keyed by repo-relative path. Pinned against the caller’s git config — core.quotepath=off, --no-ext-diff, forced a//b/ prefixes — so [new_side_path]’s b/ strip holds.
measure
Diff-scoped Python coverage floor: measure thresholds over the <base>...HEAD changed .py lines instead of the whole tree. omit is the coverage-rule exemptions; an exempt file’s changed lines drop out of the ratio with it.
measure_line_exempt
Diff-free Python coverage floor with line-scoped exemptions: measure thresholds over every measured line except the exempt_lines. omit is the whole-file coverage exemptions. Runs only when exempt_lines is non-empty.
measure_line_exempt_rust
Rust twin of measure_line_exempt: the cargo llvm-cov regions/lines metrics over every measured line except the exempt_lines. ignore is the whole-file exemptions.
measure_line_exempt_typescript
TypeScript twin of measure_line_exempt: the four vitest metrics over every measured line except the exempt_lines. exclude is the whole-file coverage exemptions.
measure_rust
Diff-scoped Rust coverage floor: the cargo llvm-cov regions/lines metrics measured over the <base>...HEAD changed .rs lines instead of the whole tree. ignore is the coverage-rule exemptions; an exempt file’s lines drop out of the ratios with it.
measure_typescript
Diff-scoped TypeScript coverage floor: the four vitest metrics measured over the <base>...HEAD changed .ts/.tsx/.mts/.cts lines instead of the whole tree. exclude is the coverage-rule exemptions; an excluded file’s lines drop out with it.