Skip to content

Commit

Permalink
./x.py clippy: allow the most noisy lints
Browse files Browse the repository at this point in the history
This silences the following clippy lints in ./x.py clippy:

many_single_char_names (there are a lot of warnings caused by stdarch)
collapsible_if (can reduce readability)
type_complexity
missing_safety_doc (there are almost 3K warnings issued)
too_many_arguments
needless_lifetimes (people want 'tcx lifetimes etc)
wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.
  • Loading branch information
matthiaskrgr committed Jan 4, 2021
1 parent 8018418 commit 6a4b24e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ fn args(builder: &Builder<'_>) -> Vec<String> {
}

if let Subcommand::Clippy { fix, .. } = builder.config.cmd {
// disable the most spammy clippy lints
let ignored_lints = vec![
"many_single_char_names", // there are a lot in stdarch
"collapsible_if",
"type_complexity",
"missing_safety_doc", // almost 3K warnings
"too_many_arguments",
"needless_lifetimes", // people want to keep the lifetimes
"wrong_self_convention",
];
let mut args = vec![];
if fix {
#[rustfmt::skip]
Expand All @@ -33,6 +43,7 @@ fn args(builder: &Builder<'_>) -> Vec<String> {
]));
}
args.extend(strings(&["--", "--cap-lints", "warn"]));
args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint)));
args
} else {
vec![]
Expand Down

0 comments on commit 6a4b24e

Please sign in to comment.