Skip to content

Commit

Permalink
use --cap-lints only when deny and forbid rules are not specified
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Mar 17, 2024
1 parent 1945e8f commit a61bf30
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ fn args(builder: &Builder<'_>) -> Vec<String> {
}
}

let all_args = std::env::args().collect::<Vec<_>>();
args.extend(strings(&["--"]));

if deny.is_empty() && forbid.is_empty() {
args.extend(strings(&["--cap-lints", "warn"]));
}

args.extend(strings(&["--", "--cap-lints", "warn"]));
let all_args = std::env::args().collect::<Vec<_>>();
args.extend(get_clippy_rules_in_order(&all_args, allow, deny, warn, forbid));

args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint)));
args.extend(builder.config.free_args.clone());
args
Expand Down

0 comments on commit a61bf30

Please sign in to comment.