rust-lang/rust-clippy

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

Open

#5,537 建立於 2020年4月27日

在 GitHub 查看
 (10 留言) (9 反應) (0 負責人)Rust (1,391 fork)batch import
A-categoryC-enhancementE-help-wantedS-needs-discussiongood first issue

倉庫指標

Star
 (10,406 star)
PR 合併指標
 (平均合併 19天 22小時) (30 天內合併 113 個 PR)

描述

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: https://github.com/rust-analyzer/rowan/pull/57#discussion_r415676159.

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.

貢獻者指南