doccover

command
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Command doccover enforces ExampleXxx coverage on ax-go's primary API surface.

Go's ExampleXxx functions compile and (when they declare an Output comment) are executed by `go test`, which makes them self-verifying documentation that cannot silently drift the way a prose comment can. Only output-declaring examples ("// Output:" or "// Unordered output:") count as coverage: a compile-only example proves nothing about behavior. doccover gates the curated primary API only: constructors, the core exported types, and the principal entry points. The broad expectation that every exported symbol carries a doc comment is enforced separately by golangci-lint (godoclint's require-doc).

Coverage is ratcheted through baseline.txt so the gate can land before every example exists. doccover fails on (1) a regression — a required symbol with no verified example that is not listed in the baseline; (2) a required symbol that is no longer exported (renamed or removed); and (3) a stale baseline entry — once a symbol gains a verified example its baseline line must be pruned, making the ratchet one-way.

Run from the module root:

go run ./internal/cmd/doccover

Jump to

Keyboard shortcuts

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