Skip to content

Full worked-example coverage across check types and inspectors, gated by a completeness test #85

Description

@abegong

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.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.
  • Follow the corpus house style from Add worked examples registry with test gating and doc generation #82 (data-first input; inline checks where they fit; schema only where the example is specifically about schemas).

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-check already gates drift.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions