You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#27.
Generates a report directory: an index page plus one annotated source page
per file, with syntax highlighting and per-line run/missing/partial marking.
--out names the output directory (default htmlcov/); HTML is never written
to stdout.
Repeat runs are incremental. A status.json records a hash of each file's
source, its coverage data and its prev/next navigation, so unchanged pages
are not rewritten. A page deleted by hand is regenerated rather than
skipped.
The index sorts by any column, filters by file name, and can hide fully
covered files. While a filter is active the footer subtotals the visible
rows and relabels itself; with no filter it shows the report's own totals
verbatim. The pages are usable with JavaScript disabled.
No new dependencies: highlighting uses stdlib tokenize.
The pages, stylesheet and script are slipcover's own; the stylesheet uses
the palette from the project logo. Line status is carried by a left border
as well as a tint, so the four categories stay distinguishable in greyscale,
in print, and for colour-blind readers.
Derived from coverage.py (Apache-2.0, as is this project), following the
precedent set by xmlreport.py: phystokens.py is a port of its tokenizer, and
htmlreport.py takes the incremental status file and the shape of the report
loop. Both retain coverage.py's original licence notices, and NOTICE
reproduces the attributions from its NOTICE.txt.
Differences from coverage.py worth noting:
- Line categories are pln/run/mis/par only. _filter_excluded_lines strips
excluded lines from the coverage data before reporting and the schema
has no excluded field, so there is nothing for an "exc" category or an
"excluded" column to show.
- A source file missing at report time renders a notice and keeps its
index row, rather than omitting the file or aborting -- the ordinary
case after --merge of coverage produced on another machine.
- The per-file hash includes prev/next navigation, so adding a file
refreshes its neighbours' links instead of leaving them stale.
- status.json is written atomically (tmp + rename); a truncated one still
self-heals into a full regeneration.
- The footer is only recomputed while a filter is actually applied, and
says so when it is. Recomputing unconditionally makes the footer
disagree with the heading under --skip-covered, which omits rows that
still count.
Under --format=html a forked child returns from the atexit handler without
writing, so two processes cannot interleave into one output directory.
Other formats are untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
help="select HTML output (shortcut for --format=html)")
217
245
ap.add_argument('--lcov-test-name', type=str, help="test name for LCOV TN: entries")
218
246
ap.add_argument('--lcov-comment', action='append', dest='lcov_comments', help="add comment lines at the beginning of LCOV output (can be used multiple times)")
0 commit comments