Documentation
¶
Overview ¶
Command covfloor checks per-package statement coverage against floors kept as data (contract cap:cli.coverage-floors, EPIC P7-GUARD decision G7).
go run -mod=vendor ./tools/covfloor -profile coverage.out -floors .github/coverage-floors.txt [-strict] [-json] go run -mod=vendor ./tools/covfloor -profile coverage.out -floors .github/coverage-floors.txt -write
The profile is the single `go test -coverprofile` output of ./...; a package is the module-relative directory of its files, and its coverage is covered statements over all statements of those files. The floors file holds one `<package> <integer floor> # comment` line per package.
It fails closed. Exit 1 when a package is below its floor, when a floors line names a package with no statements in the profile (stale), when the profile or the floors file is missing, empty or malformed, and, with -strict, when a profiled package has no floors line. Without -strict such UNFLOORED packages are only printed. -write appends the missing packages at max(0, floor(measured)-2) and never changes an existing line. Exit 2 is a usage error.