Skip to content

Add an easy way to run clippy with high FPR / trivial lints disabled #5537

Open
@matklad

Description

@matklad

Hi!

It often happens that users submit a "make clippy happier" PR to one of my projects. These PRs often contain quite a bunch of changes, of which a couple are undeniably great, but majority just shuffle code around. An example of good change would be a removal of (now useless) .into() or .clone(). A typical example of not really good change is .unwrap_or(xs.len()) -> .unwrap_or_else(|| xs.len()).

I've written at some length about this here: rust-analyzer/rowan#57 (comment).

I would really love the ability to run cargo clippy --conservative, and only get lints about the code which can be unambiguously improved across all dimensions. (that is, those lints that we probably want to lift eventually into the compiler).

I know that lint categories exists, but:

  • they seem to slice the lints across the different axis -- not the FPR range, but the, well, category
  • it's unclear how to actually make clippy run only specific category from the command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-categoryArea: Categorization of lintsC-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-help-wantedCall for participation: Help is requested to fix this issue.S-needs-discussionStatus: Needs further discussion before merging or work can be startedgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions