rust-lang / rust-lang/rust-clippy
Warn against here-links in doc comments
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
Warns when a user writes [here], [click here], [link] or [this link] in a doc comment. This lint would be in the “Style” category, as I think it is fairly universally agreed-upon that such links should be avoided (I have not seen arguments to the contrary, at least).
Advantage
Links of this form are widely considered bad for accessibility[1][2][3], among other reasons. It is recommended to change the link text to a short description of what is at the URL instead.
Drawbacks
Sometimes it is non-obvious how to rewrite a here-link into the preferred form, which could increase friction when writing docs.
Example
/// For more details on this function, click [here](crate).
Could be written as:
/// For more details on this function, see [the crate-level docs](crate).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name an implementation file or test. Start by locating Clippy's existing documentation-comment style lints and their tests, then determine where the proposed patterns should be recognized. Done means the Style lint warns for the four listed link texts and has coverage for the examples, while allowing descriptive link text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100