-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Don't emit rustdoc::broken_intra_doc_links
for GitHub-flavored Markdown admonitions like [!NOTE]
#144921
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
base: master
Are you sure you want to change the base?
Don't emit rustdoc::broken_intra_doc_links
for GitHub-flavored Markdown admonitions like [!NOTE]
#144921
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
This comment has been minimized.
This comment has been minimized.
42afec6
to
bfea0ee
Compare
This comment has been minimized.
This comment has been minimized.
a09b688
to
fa095a8
Compare
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.
Some final nits.
rustdoc::broken_intra_doc_links
for GitHub-flavored Markdown admonitions like [!NOTE]
@GuillaumeGomez What do you think about this — frankly — compatibility hack? I'm not super happy that we need to this but that's the real world for you ^^'. Should we FCP this? |
We officially support commonmark, so I don't think it's a good idea here. We could however improve the warning to say "this is github-flavored markdown, which is different than the one used in rustdoc: commonmark". |
The problem is that there's no workaround for the user as far as I can tell. There's nothing they could do to their repo |
Oh I see. Hum... Should we make a specific lint for it? Like |
No, definitely not too picky. Your position is absolutely fair because it could open the floodgates to a never-ending stream of compatibility hacks for GitHub-flavored markdown (esp. since it keeps getting extended). I wonder if we already have hacks like this in rustdoc?
That sounds like a good solution/compromise! I'm all for a new lint. We probably don't want to have |
|
Or simply Ok, enough of the bikeshedding. Let's wait for binarycat :) |
Unfortunately, even a new lint wouldn't solve the "lint level issue": #![allow(rustdoc::nonstandard_markdown)] // today: broken_intra_doc_links
#![doc = "> [!NOTE]"] // stand-in for `include_str!("path/to/README.md")`
// this one we want to allow
#![deny(rustdoc::nonstandard_markdown)] // today: broken_intra_doc_links
#![doc = "> [!NOTE]"] // this one we don't want to allow The lower 😩😖 Time for |
My reasoning for adding this logic is it is adding a simple heuristic to a lint that already uses a bunch of heuristics. I have a number of problems with a
I think if any lint should be added, it should be |
fa095a8
to
d2bfea2
Compare
addressed feedback from code review @rustbot review |
This comment has been minimized.
This comment has been minimized.
127d76f
to
cd9dad4
Compare
Just added a code comment that should hopefully clear up confusion. The main point is that regardless of what github flavored markdown does, we probably shouldn't be considering these as intra-doc link candidates for the same reason we don't consider links containing spaces to be intra-doc link candidates: item paths will never contain a space or start with a |
1c17003
to
c022ed9
Compare
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.
r=fmease,GuillaumeGomez if GuillaumeGomez also approves of this unfortunate compatibility hack (round two).
Ofc we could also poll this but I'm not sure how long it would take to reach all members (also, I dislike rfcbot poll bc it doesn't discern between "disapprove" and "haven't seen yet").
Well in this case it's not so much about markdown flavor but rather that we shouldn't try to resolve an intra-doc link starting with |
Thanks everyone! @bors r=fmease,GuillaumeGomez rollup |
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
Rollup of 15 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144386 (Extract TraitImplHeader in AST/HIR) - #144542 (Stabilize `sse4a` and `tbm` target features) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145260 (Make explicit guarantees about `Vec`’s allocator) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
Rollup of 14 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144210 (std: thread: Return error if setting thread stack size fails) - #144386 (Extract TraitImplHeader in AST/HIR) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
Rollup of 17 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144210 (std: thread: Return error if setting thread stack size fails) - #144386 (Extract TraitImplHeader in AST/HIR) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145260 (Make explicit guarantees about `Vec`’s allocator) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) - #145283 (Make I-miscompile imply I-prioritize) - #145291 (bootstrap: Only warn about `rust.debug-assertions` if downloading rustc) r? `@ghost` `@rustbot` modify labels: rollup
…-141866, r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang#141866
fixes #141866