coverage.renderer

Render a CoverageStore to an HTML report directory.

The report layout follows the familiar gcovr information architecture:

  • index.html — project summary (aggregate + per-tier breakdown) and a sortable file table.

  • files/<mangled_path>.html — per-file annotated source with a file summary block, a legend, and a code table that shows per-tier hit counts and branch status alongside the source.

Tier ordering is read from store.tier_order (the precedence order established at load time, first = highest). When the store has no tiers — typically because the run produced no coverage data — the renderer falls back to ("system",) so the templates still have something to iterate. All per-tier columns, percentages, and the winner-take-all row coloring on the annotated source view are driven by that list, so adding a new tier requires no changes here.

class otto.coverage.renderer.html_renderer.HtmlRenderer(output_dir, templates_dir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/otto-sh/checkouts/v0.4.0/src/otto/coverage/renderer/templates'), project_name='Coverage Report')

Bases: object

Render a CoverageStore to an HTML report directory.

Parameters:
  • output_dir – Directory to write the report into (created if needed).

  • templates_dir – Override for the default templates directory.

  • project_name – Title shown in the HTML report header.

render(store)

Render the full HTML report.

Return type:

None