-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new lint
doc_overindented_list_items
Add a new lint `doc_overindented_list_items` to detect and fix list items in docs that are overindented. For example, ```rs /// - first line /// second line fn foo() {} ``` this would be fixed to: ```rs /// - first line /// second line fn foo() {} ``` This lint improves readabiliy and consistency in doc.
- Loading branch information
Showing
11 changed files
with
219 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![warn(clippy::doc_overindented_list_items)] | ||
|
||
#[rustfmt::skip] | ||
/// - first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// - second list item | ||
fn foo() {} | ||
|
||
#[rustfmt::skip] | ||
/// - first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// - second list item | ||
fn bar() {} | ||
|
||
#[rustfmt::skip] | ||
/// * first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// * second list item | ||
fn baz() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![warn(clippy::doc_overindented_list_items)] | ||
|
||
#[rustfmt::skip] | ||
/// - first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// - second list item | ||
fn foo() {} | ||
|
||
#[rustfmt::skip] | ||
/// - first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// - second list item | ||
fn bar() {} | ||
|
||
#[rustfmt::skip] | ||
/// * first list item | ||
/// overindented line | ||
//~^ ERROR: doc list item overindented | ||
/// this is overindented line too | ||
//~^ ERROR: doc list item overindented | ||
/// * second list item | ||
fn baz() {} |
Oops, something went wrong.