-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert .md
links in rule documentation to full URLs
#15904
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only Mkdocs can resolve such links. When rendered by a client, typically an editor, they lead to nowhere. This might cause some frustration.
I generally view the doc-comments for the diagnostic structs themselves as external, user-facing documentation rather than internal, developer-facing documentation. So for these doc-comments, it's much more important to me how they're rendered on our website than it is how they're rendered in a tooltip by an editor. (This is the opposite from most other doc-comments we have in the codebase, which are generally just for internal documentation.) We also have lots of other special links in these doc-comments that are understood by mkdocs but that I doubt will be rendered well in an editor tooltip -- e.g. [`preview`]
will link to https://docs.astral.sh/ruff/preview/ even if [preview]: https://docs.astral.sh/ruff/preview/
is not at the bottom of the diagnostic struct's doc-comment.
However, I don't think these changes do any harm (other than maybe hardcoding our website domain in a few more places). I'm okay with them if others are.
It is precisely due to them being user-facing that the links must be made accessible. |
I sort of agree with @AlexWaygood but I also see @InSyncWithFoo's point. My preferred solution would be to move the link generation to the I'm okay landing this as a separate PR |
Yeah, I admit I hadn't considered what the output of |
(Accidentally introduced in #15904.)
Summary
Related to these comments at #15862 and #15889.
Markdown links of the following format are an anti-pattern:
Only Mkdocs can resolve such links. When rendered by a client, typically an editor, they lead to nowhere. This might cause some frustration. Additionally, documentation for other rules (e.g.,
D211
andS606
) uses the full URL form.All such instances have thus been converted to full URLs:
Test Plan
None.