Rename doc_comment_double_space_linebreak -> doc_comment_double_space_linebreaks
This commit is contained in:
parent
60191cfd5b
commit
7fe160a60d
7 changed files with 16 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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| {
|
||||
|
|
@ -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<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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
| ^^
|
||||
|
|
@ -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
|
||||
| ^^
|
||||
Loading…
Add table
Add a link
Reference in a new issue