-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: warn on empty line outer AttrKind::DocComment #10691
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Jarcho (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
61e4b45
to
fcde813
Compare
@smoelius, would you be able to review this? 😄 |
I'd be happy to. But I am not a Clippy maintainer. So my feedback wouldn't carry any "official" weight. Would you still like me to review it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait. I've been out sick for the past week so I've been moving through things slowly.
clippy_lints/src/attrs.rs
Outdated
/// by the AST. However, the average user likely considers them to be different. | ||
/// Checking for empty lines after each of these attributes is split into two different | ||
/// lints but can share the same logic. | ||
fn check_empty_line_after_outer_attr_kind(cx: &EarlyContext<'_>, item: &rustc_ast::Item, lint_doc_comment: bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason to run over the attributes twice here. Just lint all attributes on the same pass through. If the lint isn't enabled then the generated message is suppressed in the span_lint
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, changes made!
changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395
fcde813
to
0a4cfbf
Compare
No worries, totally understandable! Changes have been made. @rustbot review |
Thank you. @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
1 similar comment
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: [
empty_line_after_doc_comments
]: add lint for checking empty lines after rustdoc comments.Fixes: #10395