-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Empty docs #12342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Empty docs #12342
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3093b29
WIP: empty doc span is still broken
lucarlig 84219f4
working naive with outside check_attrs
lucarlig 09c7c5d
fix bug in check_exprs
lucarlig a3fea80
bless tests
lucarlig 9ac6125
add extra variant because no more than 3 bools
lucarlig 0ea4495
pop before trimming
lucarlig ee0cbea
ignore empty comment in semicolon_if_nothing_returned
lucarlig 97e4c57
fix lint doc
lucarlig 5a50ced
add single letter test
lucarlig f32e92c
add 1 more test and dont trim other code
lucarlig d7ad85f
move the the check into check_atr function
lucarlig f066be7
use span of fragments
lucarlig d84d9d3
lint on variant and fields as well
lucarlig ee50d5d
correct wrong doc syntax
lucarlig 5152050
move lint directly into check_attrs
lucarlig 93deced
change rs doc to no_run
lucarlig fca77c0
docs and imports
lucarlig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,67 @@ | ||
#![allow(unused)] | ||
#![warn(clippy::empty_docs)] | ||
mod outer { | ||
//! | ||
|
||
/// this is a struct | ||
struct Bananas { | ||
/// count | ||
count: usize, | ||
} | ||
|
||
/// | ||
enum Warn { | ||
/// | ||
A, | ||
B, | ||
} | ||
|
||
enum DontWarn { | ||
/// i | ||
A, | ||
B, | ||
} | ||
|
||
#[doc = ""] | ||
fn warn_about_this() {} | ||
|
||
#[doc = ""] | ||
#[doc = ""] | ||
fn this_doesn_warn() {} | ||
|
||
#[doc = "a fine function"] | ||
fn this_is_fine() {} | ||
|
||
/// | ||
mod inner { | ||
/// | ||
fn dont_warn_inner_outer() { | ||
//!w | ||
} | ||
|
||
fn this_is_ok() { | ||
//! | ||
//! inside the function | ||
} | ||
|
||
fn warn() { | ||
/*! */ | ||
} | ||
|
||
fn dont_warn() { | ||
/*! dont warn me */ | ||
} | ||
|
||
trait NoDoc { | ||
/// | ||
fn some() {} | ||
} | ||
} | ||
|
||
union Unite { | ||
/// lint y | ||
x: i32, | ||
/// | ||
y: i32, | ||
} | ||
} |
This file contains hidden or 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,77 @@ | ||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:4:5 | ||
| | ||
LL | //! | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
= note: `-D clippy::empty-docs` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::empty_docs)]` | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:12:5 | ||
| | ||
LL | /// | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:14:9 | ||
| | ||
LL | /// | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:25:5 | ||
| | ||
LL | #[doc = ""] | ||
| ^^^^^^^^^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:28:5 | ||
| | ||
LL | / #[doc = ""] | ||
LL | | #[doc = ""] | ||
| |_______________^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:35:5 | ||
| | ||
LL | /// | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:48:13 | ||
| | ||
LL | /*! */ | ||
| ^^^^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:56:13 | ||
| | ||
LL | /// | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: empty doc comment | ||
--> tests/ui/empty_docs.rs:64:9 | ||
| | ||
LL | /// | ||
| ^^^ | ||
| | ||
= help: consider removing or filling it | ||
|
||
error: aborting due to 9 previous errors | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.