-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New internal lint: unusual_names
#15794
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
base: master
Are you sure you want to change the base?
New internal lint: unusual_names
#15794
Conversation
bc0b47c
to
188849d
Compare
188849d
to
469557a
Compare
Seems reasonable. Will wait a bit if anyone on the team has anything to add. cc @rust-lang/clippy |
Sounds fine to me, feels like something we could make into a [allowed-names]
"rustc_errors::Applicability" = ["app", "applicability"]
"rustc_middle::ty::TyCtxt" = "tcx"
# etc |
I thought about this and as long as it is an internal lint only we can edit the source as easily as we would edit the configuration file. But if we make it a general lint, it would be a good idea to make it configurable of course. |
This lint aims at detecting unusual names used in Clippy source code, such as `appl` or `application` for a `rustc_errors::Applicability` variable, instead of `app` and `applicability` which are commonly used throughout Clippy. This helps maintaining the consistency of the Clippy source code.
469557a
to
4c32a55
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This lint aims at detecting unusual names used in Clippy source code, such as
appl
orapplication
for arustc_errors::Applicability
variable, instead ofapp
andapplicability
which are commonly used throughout Clippy.This helps maintaining the consistency of the Clippy source code.
It is currently implemented for:
Applicability
:app
orapplicability
EarlyContext
/LateContext
:cx
TyCtxt
:tcx
changelog: none