Skip to content

[Tech Debt] docscheck does not resolve reference-style links, autolinks, or nested-bracket link text #14

Description

@charles-fineman

Context:
Identified during work on #11
PR: #12

Description:

internal/docscheck resolves only inline Markdown links. Several standard CommonMark/GFM constructs are invisible to it, so a dead link written in any of these forms passes silently:

Form Example
Reference-style link [text][ref] with [ref]: docs/gone.md
Autolink <docs/gone.md>
Angle-bracket destination [text](<docs/gone file.md>)
Nested brackets in link text [text with [nested] brackets](docs/gone.md)
Indented (non-fenced) code block a 4-space-indented example is checked as a live claim

None appear in this repository's documentation today — verified by grep during #12 — which is why they were left out rather than fixed. They are recorded in the internal/docscheck package comment under "Known limits" so silence is not mistaken for a guarantee.

CheckNamedPaths has a related, deliberate blind spot: a candidate must begin with a segment naming a real repository-root entry, so a wholly invented top-level directory (nonexistent/foo.md) goes unreported. That rule is what keeps github.com/sofired/tracedoc, actions/setup-go, and linux/amd64 from being flagged, and it is documented and tested in TestIsRepositoryPath.

Rationale:

Deferred from #12 as false negatives rather than false positives. A missed dead link is a gap; a reported live link breaks CI on correct documentation and is what gets a gate switched off. #12 prioritised eliminating the second class — three real false positives were found and fixed in review. Closing these gaps is only worth doing if the constructs start appearing, or if the heuristic can be tightened without adding noise.

Suggested trigger: adopt this work when a reference-style link or autolink is first added to the repository's docs, rather than pre-emptively.

Reference:

  • internal/docscheck/docscheck.go — package comment, "Known limits"
  • internal/docscheck/docscheck.goinlineLink, linkText, blankFencedCode
  • internal/docscheck/docscheck_test.goTestIsRepositoryPath

Acceptance Criteria:

  • Decide per construct whether to support it or keep it documented as out of scope
  • Any construct that becomes supported has a test proving a dead link in that form is reported, and a live one is not
  • The "Known limits" list in the package comment matches what the code actually does after the change

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions