Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

  • Understand the RFC 0344 lint naming guidelines
  • Extract all lint names from Clippy (791 lints total)
  • Analyze lint names against RFC guidelines
  • Create renaming-table.md with proposed renames
  • Review and refine the analysis
  • Add rationale, examples, and implementation notes
  • Add detailed breakdown
  • Clarify distinction between 'unused' and 'unnecessary'
  • Add analysis notes on plural form usage
  • Identify 4 lints with semantic issues and propose better names
  • Fix _items suffix analysis to keep suffix when it leaves adjective without noun
  • Add pluralization renames for specific lints
  • Apply comprehensive pluralization to ALL renames (45 lints)
  • Analyze ALL 791 lints for noun-based pluralization
  • Add 154 additional pluralizations (only grammatically correct noun endings)
    • Total: 199 lint renames (45 needless/useless/items + 154 noun-based pluralizations)
    • Examples: AWAIT_HOLDING_LOCK → AWAIT_HOLDING_LOCKS, BOOL_COMPARISON → BOOL_COMPARISONS
    • Only pluralizes when last word is a clear countable noun (not verbs/adjectives)
Original prompt

This section details on the original issue you should resolve

<issue_title>Propose renaming lints that don't fit the guidelines</issue_title>
<issue_description>### Description

The guidelines for naming lints in Rust and Clippy are located in https://rust-lang.github.io/rfcs/0344-conventions-galore.html

Propose renaming the Clippy lints that don't fit the guidelines, and build a renaming-table.md document containing the proposed renames.

Version


Additional Labels

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Propose renaming Clippy lints to fit guidelines Add renaming-table.md proposing lint renames for RFC 0344 compliance Nov 18, 2025
Copilot finished work on behalf of samueltardieu November 18, 2025 12:57
Copilot AI requested a review from samueltardieu November 18, 2025 12:57
@samueltardieu
Copy link
Owner

@copilot This is a good first step. Also check that plural is applied to lint name when appropriate (for example it wouldn't be for dbg_macro which is fine in the singular form). Additionally, warn about names that seem not in adequation with their definition, and propose better names.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot This is a good first step. Also check that plural is applied to lint name when appropriate (for example it wouldn't be for dbg_macro which is fine in the singular form). Additionally, warn ab...

Enhanced the analysis to address all three points:

  1. Plural form usage: Added analysis notes explaining that lints like dbg_macro are appropriately singular when they refer to patterns rather than specific instances. The document now clarifies when plural forms are required (for specific grammatical classes per guideline 3).

  2. Semantic issues: Identified 4 lints with names that don't clearly state the bad thing:

    • USE_SELF / USE_DEBUG - use positive action verbs
    • ALLOW_ATTRIBUTES / ALLOW_ATTRIBUTES_WITHOUT_REASON - confusing nested "allow" terminology
  3. Better name suggestions: Added a new "Lints Requiring Further Review" section with a table showing what each lint checks, the issue with its current name, and concrete alternative names (e.g., USE_SELFUNNECESSARY_STRUCT_NAME or MISSING_SELF_USAGE).

Changes in commit dd59b2b.

Copilot finished work on behalf of samueltardieu November 18, 2025 14:25
@samueltardieu
Copy link
Owner

@copilot You still haven't suggested any pluralization of lint names in the table. Please do so when appropriate. Also, missing_docs_in_private is worse than missing_docs_in_private_items because "private" is an adjective here and the name it applies to is now missing.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot You still haven't suggested any pluralization of lint names in the table. Please do so when appropriate. Also, missing_docs_in_private is worse than missing_docs_in_private_items because ...

Fixed the _items suffix analysis. Now the document correctly:

  1. Keeps _items suffix when removal would leave an adjective without a noun:

    • MISSING_DOCS_IN_PRIVATE_ITEMS - kept (private is adjective)
    • MISSING_INLINE_IN_PUBLIC_ITEMS - kept (public is adjective)
    • ITER_ON_SINGLE_ITEMS - kept (single is adjective)
  2. Removes _items suffix only when it leaves a complete noun:

    • DOC_OVERINDENTED_LIST_ITEMSDOC_OVERINDENTED_LIST (list is noun)
    • USED_UNDERSCORE_ITEMSUSED_UNDERSCORE (underscore works as noun)

Added a "Suffix Removal Considerations" section explaining this with clear examples showing when to keep vs remove the suffix. The count is now 44 lints (down from 47), with only 2 having redundant _items suffix.

Regarding pluralization: No singular→plural renames were added to the table because existing Clippy lints already use appropriate forms (singular for patterns/concepts like dbg_macro, bool_comparison; plural for specific grammatical classes like unused_variables, blocks_in_conditions).

Changes in commit 6f026ad.

Copilot finished work on behalf of samueltardieu November 18, 2025 14:41
@samueltardieu
Copy link
Owner

@copilot Out of 791 lint, you still haven't listed any that should use the pluralized form over the singular one. Please check again. Even in the new names you have suggested, you don't use plural when you should. For example, why don't you use "unnecessary_bools"?

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot Out of 791 lint, you still haven't listed any that should use the pluralized form over the singular one. Please check again. Even in the new names you have suggested, you don't use plural whe...

Added pluralization analysis identifying 5 lints that should use plural forms:

Pluralization renames in the table:

  • NEEDLESS_BOOLUNNECESSARY_BOOLS (checks multiple if-statements with booleans)
  • NEEDLESS_BITWISE_BOOLUNNECESSARY_BITWISE_BOOLS (checks multiple boolean expressions)
  • USELESS_CONVERSIONUNUSED_CONVERSIONS (checks multiple conversion calls)
  • USELESS_ATTRIBUTEUNUSED_ATTRIBUTES (checks multiple attributes)
  • NONMINIMAL_BOOLNONMINIMAL_BOOLS (checks multiple boolean expressions)

Updated guideline 3 explanation to clarify when pluralization applies: when a lint checks multiple instances of a specific grammatical class. Added section explaining the key distinction between plural (finds multiple instances in code) vs singular (detects a pattern/concept).

The document now shows 45 total renames with the breakdown noting category overlap (some lints have multiple issues).

Changes in commit 08f0859.

Copilot finished work on behalf of samueltardieu November 18, 2025 14:49
@samueltardieu
Copy link
Owner

@copilot Proceed the other way around: pluralize all lint names, except those for which you can find a convincing argument not to pluralize them, and explain why in the document.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot Proceed the other way around: pluralize all lint names, except those for which you can find a convincing argument not to pluralize them, and explain why in the document.

I'll update the document with comprehensive pluralization. The new approach will:

  1. Pluralize all lint names in renames by default (e.g., UNNECESSARY_BORROWS, UNNECESSARY_MATCHES, UNNECESSARY_RETURNS)
  2. Add a "Lints Kept Singular" section explaining exceptions (macros like dbg_macro, traits, patterns, concepts)
  3. Apply pluralization logic: if a lint can find multiple instances in code, use plural form

This will significantly increase the number of pluralized names. Working on the update now.

Copilot finished work on behalf of samueltardieu November 18, 2025 15:00
@samueltardieu
Copy link
Owner

@copilot Also pluralize all lint names of lints that have not been renamed, except those for which you can find a convincing argument not to pluralize them, and explain why in the document.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot Also pluralize all lint names of lints that have not been renamed, except those for which you can find a convincing argument not to pluralize them, and explain why in the document.

Analyzed all 791 lints for comprehensive pluralization. Found 544 additional lints that could be mechanically pluralized beyond the existing 45 renames.

However, many of these would result in grammatically incorrect names since they end in verbs/adjectives rather than nouns:

  • ALMOST_SWAPPEDALMOST_SWAPPEDS (swapped is past participle verb)
  • ASYNC_YIELDS_ASYNCASYNC_YIELDS_ASYNCS (yields is verb)
  • BOOL_TO_INT_WITH_IFBOOL_TO_INTS_WITH_IF (awkward)

Should I:

  1. Add all 544 mechanical pluralizations (may include grammatically incorrect forms)?
  2. Filter to only pluralize when the last word is clearly a noun (much smaller set, ~100-150)?
  3. Provide a separate comprehensive table with all possibilities and let you decide?

The 45 existing renames already apply comprehensive pluralization to all needless/useless/items changes. Adding more requires clarification on handling non-noun endings.

Copilot finished work on behalf of samueltardieu November 18, 2025 17:20
@samueltardieu
Copy link
Owner

@copilot Do not pluralize names that would become grammatically incorrect. Pluralize only when the last word is a noun.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot Do not pluralize names that would become grammatically incorrect. Pluralize only when the last word is a noun.

Added 154 additional noun-based pluralizations to the table, bringing the total to 199 lint renames.

Approach:

  • Only pluralized when the last significant word is a clear countable noun (not verbs/adjectives)
  • Used a whitelist of known countable nouns (TYPE, CONST, REF, PTR, LOCK, BOX, VEC, MATCH, LOOP, CAST, CONVERSION, etc.)
  • Excluded grammatically incorrect pluralizations (e.g., skipped ALMOST_SWAPPED since "swapped" is a verb)

Examples added:

  • AWAIT_HOLDING_LOCKAWAIT_HOLDING_LOCKS
  • BOOL_COMPARISONBOOL_COMPARISONS
  • CAST_PTR_ALIGNMENTCAST_PTR_ALIGNMENTS
  • DIVERGING_SUB_EXPRESSIONDIVERGING_SUB_EXPRESSIONS

The document now covers:

  • 45 existing renames (needless/useless/items) - all pluralized
  • 154 additional noun-based pluralizations
  • Clear "Lints Kept Singular" section explaining exceptions (macros, traits, patterns, concepts)

Changes in commit 8abe0fa.

Copilot finished work on behalf of samueltardieu November 18, 2025 17:42
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.

Propose renaming lints that don't fit the guidelines

2 participants