You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #82 (under #30) embeds inline test-based worked examples into the pages that own each feature, but coverage is partial: 11 examples exist, 7 routed onto reference pages, covering only a handful of the ~30 check types and 2 of the inspectors. Drive this to full coverage — a worked example for every check type and inspector — and gate completeness with a test so new types can't land undocumented.
Current state
internal/examples/examples.go holds the registry; TestExamples golden-gates each example's rendered output; cmd/gendocs (examplesByPage) routes feature examples onto their reference page.
Covered today: object_field_type, object_required_field, markdown_title_matches_h1, text_forbids, the document_shape and object_fields inspectors, plus the structured-object family happy path. Every other check type and inspector has no worked example.
Task
Backfill a worked example for every remaining check type (the families under internal/checks/) and every inspector under internal/inspect/, each minimal and on-topic for its host page.
Add a completeness test that fails when a checks.Descriptor or inspect.Descriptor has no associated worked example, with an explicit, commented allowlist for any intentional exemptions — so a gap is a deliberate decision, not an oversight.
A worked, tested example on every rule's reference page makes the docs both complete and self-verifying: the same run that documents a check gates its behavior. The completeness test turns "we should add an example here" from a good intention into a CI requirement, the same way docs-gen-check already gates drift.
Summary
PR #82 (under #30) embeds inline test-based worked examples into the pages that own each feature, but coverage is partial: 11 examples exist, 7 routed onto reference pages, covering only a handful of the ~30 check types and 2 of the inspectors. Drive this to full coverage — a worked example for every check type and inspector — and gate completeness with a test so new types can't land undocumented.
Current state
internal/examples/examples.goholds the registry;TestExamplesgolden-gates each example's rendered output;cmd/gendocs(examplesByPage) routes feature examples onto their reference page.object_field_type,object_required_field,markdown_title_matches_h1,text_forbids, thedocument_shapeandobject_fieldsinspectors, plus the structured-object family happy path. Every other check type and inspector has no worked example.Task
internal/checks/) and every inspector underinternal/inspect/, each minimal and on-topic for its host page.checks.Descriptororinspect.Descriptorhas no associated worked example, with an explicit, commented allowlist for any intentional exemptions — so a gap is a deliberate decision, not an oversight.Why
A worked, tested example on every rule's reference page makes the docs both complete and self-verifying: the same run that documents a check gates its behavior. The completeness test turns "we should add an example here" from a good intention into a CI requirement, the same way
docs-gen-checkalready gates drift.Related