coverdiff

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Command coverdiff reports changed lines the tests never executed.

It exists because of a measured failure, not a metric: an entire layer of eviction handling landed across several commits with zero coverage, and a later audit proved that deleting any of it shipped green through the full validation sequence. Overall coverage percentages would not have said so — the repo's number barely moved — but "which of the lines I just changed did no test run" would have, at commit time.

Advisory by design: it prints and exits zero. Some changed lines are legitimately uncoverable here (CLI wiring, error branches that need a cloud account), so a hard gate would grow a threshold-and-exclusion system that is its own maintenance. The contract is CLAUDE.md's: run it before committing, read what it prints, and either add the test or know why not.

Usage:

go test ./... -coverprofile=.cover.out
go run ./tools/coverdiff -profile .cover.out -base HEAD

-base is any git rev; HEAD means "the working tree's uncommitted changes", HEAD~1 reviews the last commit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL