arr.iter().copied().map(String::from)
}
- if let Subcommand::Clippy { fix, .. } = builder.config.cmd {
+ if let Subcommand::Clippy {
+ fix,
+ clippy_lint_allow,
+ clippy_lint_deny,
+ clippy_lint_warn,
+ clippy_lint_forbid,
+ ..
+ } = &builder.config.cmd
+ {
// disable the most spammy clippy lints
let ignored_lints = vec![
"many_single_char_names", // there are a lot in stdarch
"wrong_self_convention",
];
let mut args = vec![];
- if fix {
+ if *fix {
#[rustfmt::skip]
args.extend(strings(&[
"--fix", "-Zunstable-options",
}
args.extend(strings(&["--", "--cap-lints", "warn"]));
args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint)));
+ let mut clippy_lint_levels: Vec<String> = Vec::new();
+ clippy_lint_allow.iter().for_each(|v| clippy_lint_levels.push(format!("-A{}", v)));
+ clippy_lint_deny.iter().for_each(|v| clippy_lint_levels.push(format!("-D{}", v)));
+ clippy_lint_warn.iter().for_each(|v| clippy_lint_levels.push(format!("-W{}", v)));
+ clippy_lint_forbid.iter().for_each(|v| clippy_lint_levels.push(format!("-F{}", v)));
+ args.extend(clippy_lint_levels);
args
} else {
vec![]