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 empty_line_after_outer_attribute false positive #8892

Merged
merged 1 commit into from
May 27, 2022

Conversation

smoelius
Copy link
Contributor

@smoelius smoelius commented May 25, 2022

This PR fixes a false positive in empty_line_after_outer_attribute.

Here is a minimal example that trigger the FP:

#[derive(clap::Parser)]
#[clap(after_help = "This ia a help message.

You're welcome.
")]
pub struct Args;

changelog: PF: [empty_line_after_outer_attribute]: No longer lints empty lines in inner string values.

@rust-highfive
Copy link

r? @Manishearth

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 25, 2022
@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Collaborator

bors commented May 27, 2022

📌 Commit 9ee211a has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented May 27, 2022

⌛ Testing commit 9ee211a with merge 7438662...

bors added a commit that referenced this pull request May 27, 2022
…hearth

Fix `empty_line_after_outer_attribute` false positive

This PR fixes a false positive in `empty_line_after_outer_attribute`.

Here is a minimal example that trigger the FP:
```rust
#[derive(clap::Parser)]
#[clap(after_help = "This ia a help message.

You're welcome.
")]
pub struct Args;
```
@bors
Copy link
Collaborator

bors commented May 27, 2022

💔 Test failed - checks-action_test

@xFrednet
Copy link
Member

The changelog was missing. I hope my addition is a correct description of the fix 🙃

@xFrednet
Copy link
Member

@bors retry

@bors
Copy link
Collaborator

bors commented May 27, 2022

⌛ Testing commit 9ee211a with merge 1dd5547...

@bors
Copy link
Collaborator

bors commented May 27, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 1dd5547 to master...

@bors bors merged commit 1dd5547 into rust-lang:master May 27, 2022
@smoelius smoelius deleted the fix-empty-line-false-positive branch May 27, 2022 21:14
@flip1995
Copy link
Member

flip1995 commented Jun 4, 2022

Uh, this added clap as another UI test dep to the Cargo.toml. I think this could've easily been avoided by writing a small custom proc_macro, that would've also reproduced this.

@flip1995
Copy link
Member

flip1995 commented Jun 4, 2022

I fixed this during the sync to rustc with commit rust-lang/rust@c22d4e6

@smoelius
Copy link
Contributor Author

smoelius commented Jun 4, 2022

Sorry, I wasn't aware of proc_macro_attr.rs.

@flip1995
Copy link
Member

flip1995 commented Jun 6, 2022

All good, you live and learn: In UI tests you can depend on files/crates in the auxiliary directory. Those can even be proc_macro crates. This is helpful if you want to test lints that check interactions with external crates, like is_external_macro or like in this case proc_macros.

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.

6 participants