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 allow_attributes_without_reason applying to external crate macros #9630

Merged
merged 1 commit into from
Oct 23, 2022

Conversation

cody-quinn
Copy link
Contributor

Previously the clippy::allow_attributes_without_reason lint would apply to external crate macros. Many macros in the Rust ecosystem include these allow attributes without adding a reason, making this lint pretty much unusable in any sizable Rust project.

This commit fixes that by adding a check to the lint if the attribute is from an external crate macro and returning early.

changelog: [`allow_attributes_without_reason`]: allow_attributes_without_reason no longer applies to external crate macros

Previously the `clippy::allow_attributes_without_reason` lint would
apply to external crate macros. Many macros in the Rust ecosystem
include these `allow` attributes without adding a reason, making this
lint pretty much unusable in any sizable Rust project.

This commit fixes that by adding a check to the lint if the attribute is
from an external crate macro and returning early.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

Please see the contribution instructions for more information.

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

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@flip1995
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 23, 2022

📌 Commit 9ebd691 has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 23, 2022

⌛ Testing commit 9ebd691 with merge fe57ab7...

@bors
Copy link
Contributor

bors commented Oct 23, 2022

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

@bors bors merged commit fe57ab7 into rust-lang:master Oct 23, 2022
@cody-quinn cody-quinn deleted the fix-aawr-lint branch October 25, 2022 08:25
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.

4 participants