hibi status looks at the claims you have. hibi cover looks the other way:
at the units that should have a claim and do not.
Scopes
A scope is declared in.hibi/hibi.toml:
What counts as covered
hibi resolves every side of every live claim. A side that resolves to exactly one unit covers that unit and every unit that encloses it. So a claim on the fieldConfig.timeout_secs also covers the struct Config and the file. The
claim’s state does not matter: a stale claim still covers, because its anchor
still points at the unit. Retired claims cover nothing.
A unit of a scope is covered when some side covers it, excluded when it is
not covered and an exclusion with that unit matches it, and uncovered
otherwise. A resource matched by an exclusion without unit has no units in
the scope at all.
Running cover
output
cover needs git, because it lists files with git. A repository without any
scope gets the error no_scopes.
Exclusions
With the exclusions above, in a later state of the same repository wheredocs/retry.md ends with the sentence “See the FAQ for more.”:
output
- An exclusion with
unitmatches that one unit, and counts units (“(1 unit)”). The unit isexcludedonly while no claim covers it. The key of a prose unit is made from its content, so when the excluded sentence changes, the exclusion stops matching and the sentence is listed again. The JSON result reports this as"matched": 0. - An exclusion without
unitmatches whole resources, and counts resources (“(1 resource)”). The scope’s line ends with “1 resource excluded”, and JSON hasexcludedResources. A matched resource is not read at all: its units are not units of the scope, so they appear in no count, it is never listed as unavailable, and a claim on one of its units does not show as covered in that scope. Heredocs/changelog.mdis such a resource, so the scope has 4 units, not 5.
From an uncovered unit to a claim
In JSON, each uncovered unit carries ananchor object that can be used as
the subject of hibi claim --stdin as it is:
output
anchor is null, and the text output says so under each:
output
cover listing them,
exclude each one by the key its hint names, or exclude the whole file.
Not every unit states something checkable: headings, examples and opinions
usually do not. Claim what can be checked against evidence. Exclude the rest
with a reason, or leave it uncovered, after agreeing with the user which is
right for the project. The optional judge can rank a long list of
uncovered prose by how likely each unit states a checkable fact.
Units that cannot be listed
A file that matches a scope but cannot be read (not UTF-8, a code file that does not parse, a code file larger than 2 MiB or another file larger than 8 MiB, a symbolic link) or an external resource whose provider fails is listed as unavailable, with the reason. Such a resource is never counted as covered and never dropped silently. To stop reading one for good, exclude it withoutunit. Here docs/bad.md is not valid UTF-8 and
docs/link.md is a symbolic link:
output

