Skip to content

Conversation

@ntBre
Copy link
Contributor

@ntBre ntBre commented Nov 18, 2025

Summary

This PR wires up the Diagnostic::set_documentation_url method from #21502 to Ruff's lint diagnostics. This enables the links for the full and concise output formats without any other changes.

I considered also including the URLs for the grouped and pylint output formats, but the grouped format is still in ruff_linter instead of ruff_db, so we'd have to export some additional functionality to wire it up with fmt_with_hyperlink; and the pylint format doesn't currently render with color, so I think it might actually be machine readable rather than human readable?

The other ouput formats (json, json-lines, junit, github, gitlab, rdjson, azure, sarif) seem more clearly not to need the links.

Test Plan

I guess you can't see my cursor or the browser opening, but it works for lint rules, which have links, and doesn't include a link for syntax errors, which don't have valid links.

out

Summary
--

This PR wires up the `Diagnostic::set_documentation_url` method from #21502 to
Ruff's lint diagnostics and renders them in the grouped output format (concise
and full are already covered by #21502).

I considered also including the URLs for the pylint output format, but it
doesn't currently render any color in the CLI, so it may be a machine-readable
format too?

Test Plan
--
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 18, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre added cli Related to the command-line interface diagnostics Related to reporting of diagnostics. labels Nov 18, 2025
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@ntBre ntBre merged commit 0645418 into main Nov 18, 2025
40 checks passed
@ntBre ntBre deleted the brent/ruff-links branch November 18, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface diagnostics Related to reporting of diagnostics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants