Skip to content

fix(docs-check): require an actual markdown link for index coverage - #113

Merged
bketelsen merged 2 commits into
mainfrom
cockpit/worker-c1f193bf83e40045
Aug 24, 2026
Merged

fix(docs-check): require an actual markdown link for index coverage#113
bketelsen merged 2 commits into
mainfrom
cockpit/worker-c1f193bf83e40045

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Summary

  • check-docs.mjs counted a doc as indexed in docs/README.md if its <category>/<name> path appeared anywhere as a substring — including in prose, comments, or fenced code examples, not just an actual markdown link.
  • Index coverage now parses real relative markdown link targets (same approach as the existing link-integrity check) and only counts a doc as indexed when a link resolves to it.

Test plan

  • node --test test/docs-integrity.test.mjs — added two regression tests: a bare-path mention fails with the missing-index diagnostic, and an actual relative link passes coverage.
  • npm run check passes at the repository root (docs check, organization check, full test suite — 13/13 tests pass).

Cockpit Worker c1f193bf83e40045 and others added 2 commits August 24, 2026 20:17
check-docs.mjs treated docs/README.md index coverage as satisfied by
any substring match of "<category>/<name>", so a bare mention of a
doc's path in prose, a comment, or a fenced example counted as an
index entry. Index coverage now parses real relative markdown link
targets the same way link-integrity does, and only counts a doc as
indexed when a link actually resolves to it.
Review round 1 blocker defect:scripts/check-docs.mjs:html-comment-links:
a commented-out markdown link (e.g. <!-- [Example](adr/example.md) -->)
in docs/README.md was counted as coverage even though it renders no
actual link. Strip HTML comment regions before extracting links, and
add a regression test proving a commented-out link still fails the
missing-index diagnostic.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bketelsen
bketelsen marked this pull request as ready for review August 24, 2026 23:18
@bketelsen
bketelsen added this pull request to the merge queue Aug 24, 2026
Merged via the queue into main with commit 77c015f Aug 24, 2026
2 checks passed
@bketelsen
bketelsen deleted the cockpit/worker-c1f193bf83e40045 branch August 24, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant