-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
clippy::missing_safety_doc: Comment indentation capped at three #5593
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Comments
flip1995
added
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
labels
May 13, 2020
Just bumped into this, here's another simple repro: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=490989da20f67791b30d3e164790fe73 pub struct Test;
impl Test {
/**
Test doc comment.
# Safety
This documents the safety requirements of the function.
*/
pub unsafe fn test() {}
} |
I ran into this as well with just standard doc comments using
|
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Sep 12, 2023
…nishearth,flip1995 Reuse rustdoc's doc comment handling in Clippy Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy Fixes rust-lang/rust-clippy#10277 Fixes rust-lang/rust-clippy#5593 Fixes rust-lang/rust-clippy#10263 Fixes rust-lang/rust-clippy#2581
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Sep 25, 2023
…nishearth,flip1995 Reuse rustdoc's doc comment handling in Clippy Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy Fixes rust-lang#10277 Fixes rust-lang#5593 Fixes rust-lang#10263 Fixes rust-lang#2581
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
When scanning comments for a
# Safety
section, clippy onlyrecognizes up to three spaces for indentation. Example:
The first function triggers
clippy::missing_safety_doc
despite the safety section being present. This is annoying
in that four spaces are required to align with the first
line of a doc comment (
/**
):Playpen link.
The lint can either be disabled or enabled, but not tweaked to
match the comment style. It would be preferable if a global base
indentation level for comment continuations could be specified
instead.
The text was updated successfully, but these errors were encountered: