1

refactor: Make lint names snake_case by Muscraft · Pull Request #13635 · rust-la...

 1 month ago
source link: https://github.com/rust-lang/cargo/pull/13635
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

When working on #13621, I somehow missed that lint names should be snake_case according to the rustc-dev-guide as well as RFC #344.

This PR renames:

  • implicit-features => implicit_featires
  • rust-2024-compatibility => rust_2024_compatibility.

Note: We should probably have some tooling to enforce this, but I was unsure if it belonged to this PR or another one. One solution would be to use a macro to create the const LINT_NAME: Lint = {...}, where LINT_NAME would be the ident as well as the name: &'static str and then have a method on Lint to make it lowercase as needed. This is what rustc does, and it could work well here. It would ensure snake case as const names need to be SCREAMING_SNAKE_CASE, or a warning is shown.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK