-
Notifications
You must be signed in to change notification settings - Fork 721
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
[WIP] Add cargo-deadlinks to CI #1078
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This found a bunch more broken links, even after the changes in #1077. Broken links
They're mostly coming from inline |
This one is weird - wasn't |
This is also weird ... it's a dependency so maybe it should be ignored? I need to look into the root cause, it might be a rustdoc bug. |
Possibly, but I wouldn't be surprised if I forgot to fix that link. |
f13e2db
to
301ef7d
Compare
I found the issue: there are a bunch of
|
f9448c6
to
eb88759
Compare
tracing-serde/src/lib.rs
Outdated
@@ -6,7 +6,7 @@ | |||
//! [![Documentation (master)][docs-master-badge]][docs-master-url] | |||
//! | |||
//! [docs-badge]: https://docs.rs/tracing-serde/badge.svg | |||
//! [docs-url]: https://docs.rs/tracing-serde | |||
//! [docs-url]: crate |
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.
What does crate
mean here? I looked over the RFC (https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) and I don't see it defined.
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.
It's a normal rust path: it means 'the crate this link is defined in', since crates don't know their own names. It will go to https://docs.rs/tracing-serde on docs.rs and to the crate root when you document locally.
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.
It is documented on https://doc.rust-lang.org/nightly/rustdoc/linking-to-items-by-name.html if that helps.
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.
Oh, thanks for the details!
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.
Sorry for the delay in reviewing this! The failing test is a known flakey one. I approved this, but I have a question about some of the syntax.
@davidbarsky sorry, I haven't been keeping the status up to date - this isn't ready for review and won't be for a while because of all the broken links:
I haven't looked in detail why the links are broken, if you want to fix them in parallel be my guest :P |
@jyn514 Gotcha, no worries. I didn't see an issue on cargo-deadlinks to print out the locations of broken links. Do you want me to open an issue there about that? |
There's an issue: deadlinks/cargo-deadlinks#14. The tricky thing is there's no simple way to reconstruct the original location from the generated docs, that requires knowledge of rustdoc internals: deadlinks/cargo-deadlinks#14 (comment) |
- Use --cfg docsrs - Only check dependencies - Pass --all-features
I won't have time to work on this in the near future. |
Motivation
Make sure that the generated documentation doesn't have broken links (#1077 (comment)).
Solution
Use
cargo deadlinks
to check all the links automatically.This doesn't use
--check-http
since that takes a while to run (and can lead to spurious failures), but I can add it if you're interested.