-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move away form blacklist terminology #5896
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthiaskrgr (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Moderating note: I think we all know what discussions this type of PR can introduce, so I want to ask everyone to stay civil and have a productive discussion about this. (I really don't want to lock this PR) cc @rust-lang/clippy Do we want to do this? Recently all internal uses of black/white-list were renamed in the compiler. No user facing things were renamed though. This would definitely be user facing, both the lint name and the configuration name. We have precedent for renaming a lint, because it could be offending to some people: #3521 |
Yea this definitely needs a renaming scheme, other than that lgtm |
It's got to be done without breaking peoples config/code. The warnings should be emitted if the old name is used with instructions for using the new name. Don't crash with an error. #3803 shows how this can be done. |
Yes imo |
FTR this is the similar pr that was merged into rustc recently: rust-lang/rust@1e567c1 I also have not objections to merging this :) , but we should definitely have some kind of deprecation message! (As far as I can see there is none as of this version of this PR..?) |
I'm also supportive of merging this (once the lint renaming handling has been added) |
I was curious about what changes in #3803 were relevant to ensuring these qualities. As far as I can tell, only the following files are relevant:
Hopefully that helps anyone else who would otherwise find themselves reading the entire diff. |
Alright, let's move forward with the renaming! @mocsy 2 things have to be done:
Each of the two steps require tests to be added. For 1. we already have a test file IIRC. For 2. add tests similar to the tests for |
All right, I'll do these steppes. |
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.
There are tests missing for the old configuration name and the renaming of the lint.
Also some test files are still named *blacklist*
, it would be great if you could rename them also.
@@ -17,33 +17,33 @@ declare_clippy_lint! { | |||
/// ```rust | |||
/// let foo = 3.14; | |||
/// ``` | |||
pub BLACKLISTED_NAME, | |||
pub DISALLOWED_NAME, |
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.
Let's rename it properly:
pub DISALLOWED_NAME, | |
pub DISALLOWED_NAMES, |
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.
I believe it's the lint definition which is in singular:
#![warn(clippy::blacklisted_name)]
not the toml entry:
blacklisted-names = ["toto", "tata", "titi"]
which is in plural.
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.
Yeah, but it should be in plural, as per our lint naming conventions (point 3)
r? @flip1995 |
|
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.
There is still a test missing for the renamed configuration option (or did I miss this test?)
LL | fn test(foo: ()) {} | ||
| ^^^ | ||
LL | #![warn(clippy::blacklisted_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_name` |
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.
Please include the rename tests in tests/ui/rename.rs
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.
Okay, shall I remove tests/ui/blacklisted_name
then?
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.
Yes, after you have one #[warn(clippy::blacklisted_name)]
in the rename test file you can remove this.
☔ The latest upstream changes (presumably #6036) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
ping from triage @mocsy. Anything I can help you with to get this over the finish line? |
@flip1995 2 weeks have passed with no activity from previous ping, so this PR should be closed according to Rust triage procedure. |
@rustbot modify labels: -S-waiting-on-author +S-inactive-closed |
…shearth Remove "blacklist" terminology Picking up where #5896 left off, this renames the `blacklisted_name` lint to `disallowed_names` (pluralised for compliance with naming conventions). The old name is still available though is deprecated (both in the lint name, and in the TOML configuration file). This has been proposed/requested a few times, most recently in #7582 where `@xFrednet` suggested pinging the Clippy team when a PR was created hence... cc: `@rust-lang/clippy` changelog: [`disallowed_names`] lint replaces `blacklisted_name`
@rustbot label -S-inactive-closed |
changelog: Move away form blacklist terminology