-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow giving reasons for disallowed_types
#7791
Conversation
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
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. |
There was a problem hiding this 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?
rust-clippy/clippy_lints/src/disallowed_method.rs
Lines 21 to 30 in 9205e3d
/// # 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" }, | |
/// ] |
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
Thanks for the review @giraffate . I hope I've now addressed both of your comments. |
@bors r+ It looks good, thanks! |
📌 Commit 886cbb1 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Similar to #7609 but for the
disallowed_type
lint. The permitted form of configuration is the same as fordisallowed_methods
.changelog: Allow giving reasons for [
disallowed_type
]