doc_comment_double_space_linebreaks: Fix tests

This commit is contained in:
xFrednet 2025-03-01 12:13:46 +01:00
parent 7fe160a60d
commit 45e44878a7
No known key found for this signature in database
GPG key ID: E126C23F63C8907A
4 changed files with 32 additions and 23 deletions

View file

@ -1,9 +1,10 @@
#![feature(custom_inner_attributes)]
#![rustfmt::skip]
#![warn(clippy::doc_comment_double_space_linebreak)]
#![warn(clippy::doc_comment_double_space_linebreaks)]
#![allow(unused, clippy::empty_docs)]
//~v doc_comment_double_space_linebreaks
//! Should warn on double space linebreaks\
//! in file/module doc comment
@ -22,16 +23,17 @@ fn single_line_split() {}
#[doc = "This is a doc attribute, which should not be linted"]
fn normal_comment() {
/*
Should not warn on block comments
*/
/*
Should not warn on block comments
with double space at the end of a line
*/
/*
Should not warn on block comments
*/
/*
Should not warn on block comments
with double space at the end of a line
*/
}
//~v doc_comment_double_space_linebreaks
/// Should warn when doc comment uses double space\
/// as a line-break, even when there are multiple\
/// in a row
@ -41,6 +43,7 @@ fn double_space_doc_comment() {}
/// as a line-break
fn back_slash_doc_comment() {}
//~v doc_comment_double_space_linebreaks
/// 🌹 are 🟥\
/// 🌷 are 🟦\
/// 📎 is 😎\
@ -83,6 +86,7 @@ fn inline() {}
/// https://example.com) in a URL.
fn url() {}
//~v doc_comment_double_space_linebreaks
/// here we mix\
/// double spaces\
/// and also\

View file

@ -1,9 +1,10 @@
#![feature(custom_inner_attributes)]
#![rustfmt::skip]
#![warn(clippy::doc_comment_double_space_linebreak)]
#![warn(clippy::doc_comment_double_space_linebreaks)]
#![allow(unused, clippy::empty_docs)]
//~v doc_comment_double_space_linebreaks
//! Should warn on double space linebreaks
//! in file/module doc comment
@ -22,16 +23,17 @@ fn single_line_split() {}
#[doc = "This is a doc attribute, which should not be linted"]
fn normal_comment() {
/*
Should not warn on block comments
*/
/*
Should not warn on block comments
with double space at the end of a line
*/
/*
Should not warn on block comments
*/
/*
Should not warn on block comments
with double space at the end of a line
*/
}
//~v doc_comment_double_space_linebreaks
/// Should warn when doc comment uses double space
/// as a line-break, even when there are multiple
/// in a row
@ -41,6 +43,7 @@ fn double_space_doc_comment() {}
/// as a line-break
fn back_slash_doc_comment() {}
//~v doc_comment_double_space_linebreaks
/// 🌹 are 🟥
/// 🌷 are 🟦
/// 📎 is 😎
@ -83,6 +86,7 @@ fn inline() {}
/// https://example.com) in a URL.
fn url() {}
//~v doc_comment_double_space_linebreaks
/// here we mix
/// double spaces\
/// and also

View file

@ -1,15 +1,15 @@
error: doc comment uses two spaces for a hard line break
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:7:43
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:8: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`
= note: `-D clippy::doc-comment-double-space-linebreaks` implied by `-D warnings`
= 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_linebreaks.rs:35:51
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:37: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_linebreaks.rs:44:12
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:47: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_linebreaks.rs:86:16
--> tests/ui/doc/doc_comment_double_space_linebreaks.rs:90:16
|
LL | /// here we mix
| ^^