
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.
136 lines
3.4 KiB
Text
136 lines
3.4 KiB
Text
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:5:5
|
|
|
|
|
LL | /// lazy continuation
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= note: `-D clippy::doc-lazy-continuation` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]`
|
|
help: indent this line
|
|
|
|
|
LL | /// lazy continuation
|
|
| +++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:10:5
|
|
|
|
|
LL | /// lazy list continuations don't make warnings with this lint
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// lazy list continuations don't make warnings with this lint
|
|
| +++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:12:5
|
|
|
|
|
LL | /// because they don't have the
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// because they don't have the
|
|
| +++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:17:5
|
|
|
|
|
LL | /// lazy continuation
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// lazy continuation
|
|
| ++++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:22:5
|
|
|
|
|
LL | /// lazy list continuations don't make warnings with this lint
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// lazy list continuations don't make warnings with this lint
|
|
| ++++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:24:5
|
|
|
|
|
LL | /// because they don't have the
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// because they don't have the
|
|
| ++++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:29:5
|
|
|
|
|
LL | /// lazy continuation
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// lazy continuation
|
|
| ++++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:34:5
|
|
|
|
|
LL | /// this will warn on the lazy continuation
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// this will warn on the lazy continuation
|
|
| ++++++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:36:5
|
|
|
|
|
LL | /// and so should this
|
|
| ^^^^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// and so should this
|
|
| ++
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:57:5
|
|
|
|
|
LL | /// 'protocol_descriptors': [
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// 'protocol_descriptors': [
|
|
| +
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_list.rs:76:5
|
|
|
|
|
LL | /// ]
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
help: indent this line
|
|
|
|
|
LL | /// ]
|
|
| +
|
|
|
|
error: aborting due to 11 previous errors
|
|
|