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.

@samueltardieu samueltardieu force-pushed the features/unusual-names branch from 469557a to 4c32a55 Compare October 6, 2025 22:31
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

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 4c32a55 to 5de7da8 Compare October 11, 2025 07:37
@rustbot
Copy link
Collaborator

rustbot commented Oct 11, 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.

@samueltardieu
Copy link
Member Author

Are there any blockers to merge this new internal lint?

@Jarcho
Copy link
Contributor

Jarcho commented Oct 14, 2025

I don't think anything actually blocks this. A more general lint can be added later and replace this if it's useful. We already have internal only symbols being added and I have a solution to separate them.

@blyxyas
Copy link
Member

blyxyas commented Oct 14, 2025

The concern I raised is now resolved, if you're looking for it. I'll do an experiment soon and if there isn't anything relevant, just ignore it and let it be.

@Jarcho Jarcho added this pull request to the merge queue Oct 14, 2025
Merged via the queue into rust-lang:master with commit eee8ef8 Oct 14, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 14, 2025
@samueltardieu samueltardieu deleted the features/unusual-names branch October 15, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants