Skip to content
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

Merged
merged 1 commit into from
May 12, 2023

Conversation

jdswensen
Copy link
Contributor

changelog: [empty_line_after_doc_comments]: add lint for checking empty lines after rustdoc comments.

Fixes: #10395

@rustbot
Copy link
Collaborator

rustbot commented Apr 21, 2023

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 (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 21, 2023
@jdswensen
Copy link
Contributor Author

@smoelius, would you be able to review this? 😄

@smoelius
Copy link
Contributor

smoelius commented May 4, 2023

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?

Copy link
Contributor

@Jarcho Jarcho left a 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.

/// 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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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
@jdswensen
Copy link
Contributor Author

Sorry for the long wait. I've been out sick for the past week so I've been moving through things slowly.

No worries, totally understandable! Changes have been made.

@rustbot review

@jdswensen jdswensen requested a review from Jarcho May 12, 2023 04:05
@Jarcho
Copy link
Contributor

Jarcho commented May 12, 2023

Thank you. @bors r+

@bors
Copy link
Contributor

bors commented May 12, 2023

📌 Commit 0a4cfbf has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 12, 2023

⌛ Testing commit 0a4cfbf with merge fff790b...

@bors
Copy link
Contributor

bors commented May 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing fff790b to master...

1 similar comment
@bors
Copy link
Contributor

bors commented May 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing fff790b to master...

@bors bors merged commit fff790b into rust-lang:master May 12, 2023
@jdswensen jdswensen deleted the jds/fix-doc-empty-line branch May 12, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

empty_line_after_outer_attr doesn't seem to work for rustdoc comments
5 participants