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

Allow giving reasons for disallowed_types #7791

Merged
merged 3 commits into from
Oct 12, 2021

Conversation

JamesHinshelwood
Copy link
Contributor

Similar to #7609 but for the disallowed_type lint. The permitted form of configuration is the same as for disallowed_methods.

changelog: Allow giving reasons for [disallowed_type]

Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
@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 @giraffate (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 8, 2021
Copy link
Contributor

@giraffate giraffate left a comment

Choose a reason for hiding this comment

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

Can you add an example with reason like this?

/// # clippy.toml
/// disallowed-methods = [
/// # Can use a string as the path of the disallowed method.
/// "std::boxed::Box::new",
/// # Can also use an inline table with a `path` key.
/// { path = "std::time::Instant::now" },
/// # When using an inline table, can add a `reason` for why the method
/// # is disallowed.
/// { path = "std::vec::Vec::leak", reason = "no leaking memory" },
/// ]

clippy_lints/src/disallowed_type.rs Outdated Show resolved Hide resolved
JamesHinshelwood and others added 2 commits October 11, 2021 08:29
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
@JamesHinshelwood
Copy link
Contributor Author

Thanks for the review @giraffate . I hope I've now addressed both of your comments.

@giraffate
Copy link
Contributor

@bors r+

It looks good, thanks!

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

📌 Commit 886cbb1 has been approved by giraffate

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

⌛ Testing commit 886cbb1 with merge 77dda9c...

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: giraffate
Pushing 77dda9c to master...

@bors bors merged commit 77dda9c into rust-lang:master Oct 12, 2021
@JamesHinshelwood JamesHinshelwood deleted the reason-in-disallowed-type branch October 12, 2021 07:34
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