Skip to content

feat: Link every diagnostic to its entry on the Linter Rules page. - #68

Merged
goloroden merged 3 commits into
mainfrom
link-diagnostics-to-linter-rules
Sep 17, 2026
Merged

goloroden merged 3 commits into
mainfrom
link-diagnostics-to-linter-rules

Conversation

@goloroden

Copy link
Copy Markdown
Member

Closes #66.

What changed

  • Every diagnostic carries the URL of its entry on the Linter Rules pages. The human format prints it as a dimmed see line at the end of each block; the JSON format adds documentationUrl.
  • Meta.DocumentationURL() derives the address from the rule's metadata: the site, the Linter Rules page of the rule's extension (or the core page), and the anchor #<category>-<name> the pages already use. Nothing is stored per rule, so the URL cannot drift away from the page.
  • The runner's rule reporter stamps the URL alongside RuleID and Severity. The diagnostics of parser, resolver, and runner carry only an ID; the pipeline fills in their URL before returning, and a Meta built from a bare ID resolves to the core page, where those entries live.
  • A documentation test turns every URL back into a page path and checks that the page exists, so a moved or renamed page fails the build before a user follows a dead link.
  • The CLI reference and the lint guide describe the see line and the JSON field; the guide's example output shows the new line.
  • Side finding, fixed here: the documentation claimed the JSON output is "one object per line". The formatter writes a pretty-printed array, and both passages now say so.

Why

A finding named a rule ID but offered no way to the explanation. With the Linter Rules pages from #53 in place, the linter can point at the exact entry, from the terminal and from tooling that consumes the JSON output.

Verification

make qa is green, mkdocs build --strict is clean. Running the linter on a broken model shows the see line in the human format and documentationUrl in the JSON output. The links resolve once the pages are published with the next release.

🤖 Generated with Claude Code

https://claude.ai/code/session_014C8sbpnyEX9WQ3C3BP1KQ2

goloroden and others added 3 commits September 17, 2026 08:30
Meta.DocumentationURL joins the documentation site, the Linter Rules
page of the rule's extension (or the core page), and the rule's
anchor. A Meta built from a bare ID resolves to the core page, which
is where the diagnostics of parser, resolver, and runner are
documented.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014C8sbpnyEX9WQ3C3BP1KQ2
Diagnostic carries a DocumentationURL. The runner's rule reporter
stamps it from Meta alongside RuleID and Severity, and the pipeline
fills it in for the diagnostics of parser, resolver, and runner
before returning. A documentation test checks that every URL points
at an existing page.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014C8sbpnyEX9WQ3C3BP1KQ2
The human format ends every block with a dimmed see line, the JSON
format adds documentationUrl. The CLI reference and the lint guide
describe both; the guide's description of the JSON output now
matches what the formatter writes, a pretty-printed array rather
than one object per line.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014C8sbpnyEX9WQ3C3BP1KQ2
@goloroden
goloroden requested a review from a team as a code owner September 17, 2026 06:57
@goloroden
goloroden merged commit d0a481f into main Sep 17, 2026
7 checks passed
@goloroden
goloroden deleted the link-diagnostics-to-linter-rules branch September 17, 2026 08:22
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.

Link every diagnostic to its entry on the Linter Rules page

1 participant