Skip to content

Commit

Permalink
Rename doc_comment_double_space_linebreak -> `doc_comment_double_sp…
Browse files Browse the repository at this point in the history
…ace_linebreaks`
  • Loading branch information
xFrednet committed Mar 1, 2025
1 parent 60191cf commit 7fe160a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5570,7 +5570,7 @@ Released 2018-09-13
[`disallowed_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_type
[`disallowed_types`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
[`diverging_sub_expression`]: https://rust-lang.github.io/rust-clippy/master/index.html#diverging_sub_expression
[`doc_comment_double_space_linebreak`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_comment_double_space_linebreak
[`doc_comment_double_space_linebreaks`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_comment_double_space_linebreaks
[`doc_include_without_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_include_without_cfg
[`doc_lazy_continuation`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[`doc_link_code`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_code
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/declared_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub static LINTS: &[&crate::LintInfo] = &[
crate::disallowed_names::DISALLOWED_NAMES_INFO,
crate::disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS_INFO,
crate::disallowed_types::DISALLOWED_TYPES_INFO,
crate::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAK_INFO,
crate::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS_INFO,
crate::doc::DOC_INCLUDE_WITHOUT_CFG_INFO,
crate::doc::DOC_LAZY_CONTINUATION_INFO,
crate::doc::DOC_LINK_CODE_INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc_errors::Applicability;
use rustc_lint::LateContext;
use rustc_span::{BytePos, Span};

use super::DOC_COMMENT_DOUBLE_SPACE_LINEBREAK;
use super::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS;

pub fn check(cx: &LateContext<'_>, collected_breaks: &[Span]) {
if collected_breaks.is_empty() {
Expand All @@ -17,7 +17,7 @@ pub fn check(cx: &LateContext<'_>, collected_breaks: &[Span]) {

span_lint_and_then(
cx,
DOC_COMMENT_DOUBLE_SPACE_LINEBREAK,
DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS,
breaks.clone(),
"doc comment uses two spaces for a hard line break",
|diag| {
Expand Down
15 changes: 7 additions & 8 deletions clippy_lints/src/doc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![allow(clippy::lint_without_lint_pass)]

mod lazy_continuation;
mod too_long_first_doc_paragraph;

use clippy_config::Conf;
use clippy_utils::attrs::is_doc_hidden;
use clippy_utils::diagnostics::{span_lint, span_lint_and_help, span_lint_and_then};
Expand Down Expand Up @@ -34,13 +31,15 @@ use rustc_span::{Span, sym};
use std::ops::Range;
use url::Url;

mod doc_comment_double_space_linebreak;
mod doc_comment_double_space_linebreaks;
mod include_in_doc_without_cfg;
mod lazy_continuation;
mod link_with_quotes;
mod markdown;
mod missing_headers;
mod needless_doctest_main;
mod suspicious_doc_comments;
mod too_long_first_doc_paragraph;

declare_clippy_lint! {
/// ### What it does
Expand Down Expand Up @@ -595,8 +594,8 @@ declare_clippy_lint! {
/// l + r
/// }
/// ```
#[clippy::version = "1.80.0"]
pub DOC_COMMENT_DOUBLE_SPACE_LINEBREAK,
#[clippy::version = "1.87.0"]
pub DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS,
pedantic,
"double-space used for doc comment linebreak instead of `\\`"
}
Expand Down Expand Up @@ -632,7 +631,7 @@ impl_lint_pass!(Documentation => [
DOC_OVERINDENTED_LIST_ITEMS,
TOO_LONG_FIRST_DOC_PARAGRAPH,
DOC_INCLUDE_WITHOUT_CFG,
DOC_COMMENT_DOUBLE_SPACE_LINEBREAK
DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS
]);

impl EarlyLintPass for Documentation {
Expand Down Expand Up @@ -1164,7 +1163,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
}
}

doc_comment_double_space_linebreak::check(cx, &collected_breaks);
doc_comment_double_space_linebreaks::check(cx, &collected_breaks);

headers
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error: doc comment uses two spaces for a hard line break
--> tests/ui/doc/doc_comment_double_space_linebreak.rs:7:43
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:7:43
|
LL | //! Should warn on double space linebreaks
| ^^
|
= help: replace this double space with a backslash: `\`
= note: `-D clippy::doc-comment-double-space-linebreak` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::doc_comment_double_space_linebreak)]`
= help: to override `-D warnings` add `#[allow(clippy::doc_comment_double_space_linebreaks)]`

error: doc comment uses two spaces for a hard line break
--> tests/ui/doc/doc_comment_double_space_linebreak.rs:35:51
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:35:51
|
LL | /// Should warn when doc comment uses double space
| ^^
Expand All @@ -19,7 +19,7 @@ LL | /// as a line-break, even when there are multiple
= help: replace this double space with a backslash: `\`

error: doc comment uses two spaces for a hard line break
--> tests/ui/doc/doc_comment_double_space_linebreak.rs:44:12
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:44:12
|
LL | /// 🌹 are 🟥
| ^^
Expand All @@ -33,7 +33,7 @@ LL | /// and so are 🫵
= help: replace this double space with a backslash: `\`

error: doc comment uses two spaces for a hard line break
--> tests/ui/doc/doc_comment_double_space_linebreak.rs:86:16
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:86:16
|
LL | /// here we mix
| ^^
Expand Down

0 comments on commit 7fe160a

Please sign in to comment.