-
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.
doc_refdef_list_item: new lint for suspicious list syntax
This is more likely to be intended as an intra-doc link than it is to be intended as a refdef. If a refdef is intended, it does not need to be nested within a list item. ```markdown - [`LONG_INTRA_DOC_LINK`]: this looks like an intra-doc link, but is actually a refdef. The first line will seem to disappear when rendered as HTML. ```
- Loading branch information
Showing
6 changed files
with
373 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// https://github.com/rust-lang/rust/issues/133150 | ||
#![warn(clippy::doc_refdef_list_item)] | ||
#[rustfmt::skip] | ||
/// - [link][]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link][]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link][]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link]: not def | ||
/// | ||
/// - [link][]: notdef | ||
/// | ||
/// - [link]\: notdef | ||
pub struct Empty; | ||
|
||
#[rustfmt::skip] | ||
/// - [link][]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link][]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link][]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link]: not def | ||
/// - [link][]: notdef | ||
/// - [link]\: notdef | ||
pub struct EmptyTight; | ||
|
||
#[rustfmt::skip] | ||
/// - [link][]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link][]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link][]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link]: not def | ||
/// inner text | ||
/// | ||
/// - [link][]: notdef | ||
/// inner text | ||
/// | ||
/// - [link]\: notdef | ||
/// inner text | ||
pub struct NotEmpty; | ||
|
||
#[rustfmt::skip] | ||
/// - [link][]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link][]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link][]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link]: not def | ||
/// inner text | ||
/// - [link][]: notdef | ||
/// inner text | ||
/// - [link]\: notdef | ||
/// inner text | ||
pub struct NotEmptyTight; |
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,71 @@ | ||
// https://github.com/rust-lang/rust/issues/133150 | ||
#![warn(clippy::doc_refdef_list_item)] | ||
#[rustfmt::skip] | ||
/// - [link]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// | ||
/// - [link]: not def | ||
/// | ||
/// - [link][]: notdef | ||
/// | ||
/// - [link]\: notdef | ||
pub struct Empty; | ||
|
||
#[rustfmt::skip] | ||
/// - [link]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// - [link]: not def | ||
/// - [link][]: notdef | ||
/// - [link]\: notdef | ||
pub struct EmptyTight; | ||
|
||
#[rustfmt::skip] | ||
/// - [link]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// | ||
/// - [link]: not def | ||
/// inner text | ||
/// | ||
/// - [link][]: notdef | ||
/// inner text | ||
/// | ||
/// - [link]\: notdef | ||
/// inner text | ||
pub struct NotEmpty; | ||
|
||
#[rustfmt::skip] | ||
/// - [link]: def | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link]: def (title) | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link]: def "title" | ||
//~^ ERROR: link reference defined in list item | ||
/// inner text | ||
/// - [link]: not def | ||
/// inner text | ||
/// - [link][]: notdef | ||
/// inner text | ||
/// - [link]\: notdef | ||
/// inner text | ||
pub struct NotEmptyTight; |
Oops, something went wrong.