|
|
Completes the coverage v1 user-facing path. cj/coverage-report is the interactive entry point:
1. Resolves the backend for the current project (honoring cj/coverage-backend from .dir-locals.el).
2. Prompts for a git-diff scope via completing-read (Working tree, Staged, Branch vs parent, Branch vs main).
3. Reads the cached simplecov report, intersects with the diff, renders records into a *Coverage Report* buffer.
4. If the report doesn't exist, prompts to run coverage first. With a prefix argument, re-runs regardless.
The report buffer uses cj/coverage-report-mode, a compilation-mode derivative. Uncovered-line entries are formatted as path:line: uncovered so the standard gnu compilation-error-regexp-alist picks them up for next-error navigation. That means M-g n, M-g p, and C-x backtick walk through uncovered lines from any buffer without switching focus.
F7 is bound to the command globally, matching the F-key layout ticket's design (F4 compile+run, F5 debug, F6 test, F7 coverage).
Added to init.el: (require 'coverage-core) + (require 'coverage-elisp).
Tests cover the pure scope-label helpers (label to symbol, symbol to label, roundtrip) plus a smoke test that exercises the full command with stubbed backend, stubbed completing-read, stubbed shell-command-to-string, and a prepared simplecov fixture.
Coverage v1 is now functionally complete: make coverage produces the report, F7 drives the interactive flow.
|