feat(lint): Making the lint name a terminal hyperlink to docs - #17538
Conversation
a64a8ba to
2fc9659
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| source: LintLevelSource, | ||
| gctx: &GlobalContext, | ||
| ) -> String { | ||
| let url = cargo_docs_link(&format!("reference/lints.html#{}", self.name)); |
There was a problem hiding this comment.
All Cargo lints are automatically scraped and compiled into doc/book/src/reference/lints.md via xtask-lint-docs hence it contains all lint definitions.
|
r? @weihanglo |
|
FWIW, we might want to also detect the toolchain channel/version and prepend that in the URL. For example, the |
But cargo_docs_link() already handles this so I think we are safe. |
|
That only handles channel. I wonder if it should also handle version in the Most other docs aren't as version sensitive as lints which is probably why we didn't do it before. |
0de9127 to
fb855f0
Compare
What does this PR try to resolve?
closes #17438
Change was to modify
fn emmited_sourceto make name a hyperlink. Had to takegctxas arg to prints the terminal escape code for hyperlink.Updated rest the files accordingly to pass
gctxtoemmited_sourceas new argument.How to test and review this PR?
Run
cargo test --test testsuite -- lintsall 101 tests passed. (Snapshots were updated to have<a>tag)