Skip to content

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Sep 30, 2025

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.

It is currently implemented for:

  • Applicability: app or applicability
  • EarlyContext/LateContext: cx
  • TyCtxt: tcx

changelog: none

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@samueltardieu samueltardieu marked this pull request as draft September 30, 2025 15:36
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 30, 2025
@samueltardieu samueltardieu marked this pull request as ready for review September 30, 2025 17:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 30, 2025
@Jarcho
Copy link
Contributor

Jarcho commented Oct 1, 2025

Seems reasonable. Will wait a bit if anyone on the team has anything to add.

cc @rust-lang/clippy

@Alexendoo
Copy link
Member

Sounds fine to me, feels like something we could make into a disallowed- style lint

[allowed-names]
"rustc_errors::Applicability" = ["app", "applicability"]
"rustc_middle::ty::TyCtxt" = "tcx"
# etc

@samueltardieu
Copy link
Member Author

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.
@samueltardieu samueltardieu force-pushed the features/unusual-names branch from 469557a to 4c32a55 Compare October 6, 2025 22:31
@rustbot
Copy link
Collaborator

rustbot commented Oct 6, 2025

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.

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