Skip to content

fix: warn on empty line outer AttrKind::DocComment#10691

Merged
bors merged 1 commit into
rust-lang:masterfrom
jdswensen:jds/fix-doc-empty-line
May 12, 2023
Merged

fix: warn on empty line outer AttrKind::DocComment#10691
bors merged 1 commit into
rust-lang:masterfrom
jdswensen:jds/fix-doc-empty-line

Conversation

@jdswensen

Copy link
Copy Markdown
Contributor

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

Fixes: #10395

@rustbot

rustbot commented Apr 21, 2023

Copy link
Copy Markdown
Collaborator

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 jdswensen force-pushed the jds/fix-doc-empty-line branch from 61e4b45 to fcde813 Compare April 21, 2023 23:12
@jdswensen

Copy link
Copy Markdown
Contributor Author

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

@smoelius

smoelius commented May 4, 2023

Copy link
Copy Markdown
Contributor

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?

@Jarcho Jarcho left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread 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) {

Copy link
Copy Markdown
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
Copy Markdown
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 jdswensen force-pushed the jds/fix-doc-empty-line branch from fcde813 to 0a4cfbf Compare May 11, 2023 01:41
@jdswensen

Copy link
Copy Markdown
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

Jarcho commented May 12, 2023

Copy link
Copy Markdown
Contributor

Thank you. @bors r+

@bors

bors commented May 12, 2023

Copy link
Copy Markdown
Contributor

📌 Commit 0a4cfbf has been approved by Jarcho

It is now in the queue for this repository.

@bors

bors commented May 12, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit 0a4cfbf with merge fff790b...

@bors

bors commented May 12, 2023

Copy link
Copy Markdown
Contributor

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

1 similar comment
@bors

bors commented May 12, 2023

Copy link
Copy Markdown
Contributor

☀️ 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