Skip to main content

Module coverage

Module coverage 

Source
Expand description

Diff/patch coverage analysis.

Ingests a per-line coverage report (lcov / llvm-cov JSON / cobertura) plus a git diff and produces PR-attributable coverage: patch coverage (the fraction of lines the diff added that are covered), the explicit list of uncovered new lines, project before/after deltas, and indirect coverage flips on unchanged lines.

Pipeline:

  1. format::parse turns report text into a per-line model::CoverageReport.
  2. diff::DiffModel::between builds the added-line sets and base↔head alignment from git2.
  3. analysis::analyze attributes coverage to the diff.
  4. render::render emits markdown / YAML / JSON.

Re-exports§

pub use analysis::analyze;
pub use analysis::CoverageDiff;
pub use analysis::DiffScope;
pub use diff::default_base_ref;
pub use diff::DiffModel;
pub use format::parse;
pub use format::Format;
pub use model::CoverageReport;
pub use model::FileCoverage;
pub use render::render;
pub use render::OutputFormat;
pub use render::RenderOptions;

Modules§

analysis
Coverage attribution: combine a head per-line report with a DiffModel (and optionally a baseline report) into the metrics a reviewer wants.
cobertura
Cobertura XML coverage parser (line coverage only).
diff
Unified-diff model built from git2.
format
Coverage report format detection and parse dispatch.
lcov
lcov trace-file parser (line coverage only).
llvm_json
llvm-cov JSON export parser (cargo llvm-cov report --json).
model
The per-line coverage model that every parser produces.
render
Rendering of a CoverageDiff to markdown, YAML, or JSON.