From 7fe160a60d58456dff82fec397d330f22cb00242 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Sat, 1 Mar 2025 11:50:26 +0100 Subject: [PATCH] Rename `doc_comment_double_space_linebreak` -> `doc_comment_double_space_linebreaks` --- CHANGELOG.md | 2 +- clippy_lints/src/declared_lints.rs | 2 +- ....rs => doc_comment_double_space_linebreaks.rs} | 4 ++-- clippy_lints/src/doc/mod.rs | 15 +++++++-------- ... => doc_comment_double_space_linebreaks.fixed} | 0 ....rs => doc_comment_double_space_linebreaks.rs} | 0 ...=> doc_comment_double_space_linebreaks.stderr} | 10 +++++----- 7 files changed, 16 insertions(+), 17 deletions(-) rename clippy_lints/src/doc/{doc_comment_double_space_linebreak.rs => doc_comment_double_space_linebreaks.rs} (90%) rename tests/ui/doc/{doc_comment_double_space_linebreak.fixed => doc_comment_double_space_linebreaks.fixed} (100%) rename tests/ui/doc/{doc_comment_double_space_linebreak.rs => doc_comment_double_space_linebreaks.rs} (100%) rename tests/ui/doc/{doc_comment_double_space_linebreak.stderr => doc_comment_double_space_linebreaks.stderr} (83%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94550f531ac4..0d42eaf53d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index a99c9ce46354..7092a282c882 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -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, diff --git a/clippy_lints/src/doc/doc_comment_double_space_linebreak.rs b/clippy_lints/src/doc/doc_comment_double_space_linebreaks.rs similarity index 90% rename from clippy_lints/src/doc/doc_comment_double_space_linebreak.rs rename to clippy_lints/src/doc/doc_comment_double_space_linebreaks.rs index c9aee09f72e4..4cc027022333 100644 --- a/clippy_lints/src/doc/doc_comment_double_space_linebreak.rs +++ b/clippy_lints/src/doc/doc_comment_double_space_linebreaks.rs @@ -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() { @@ -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| { diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs index 1317bbb47273..8e5682494e9e 100644 --- a/clippy_lints/src/doc/mod.rs +++ b/clippy_lints/src/doc/mod.rs @@ -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}; @@ -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 @@ -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 `\\`" } @@ -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 { @@ -1164,7 +1163,7 @@ fn check_doc<'a, Events: Iterator, Range 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 | ^^ @@ -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 🟥 | ^^ @@ -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 | ^^