From 6d79f62a328e853be1e9bda220f80964fda222cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 2 Jan 2025 15:50:36 +0100 Subject: [PATCH] refactor(xtask): extract clippy base --- xtask/src/clippy.rs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/xtask/src/clippy.rs b/xtask/src/clippy.rs index 6919403d2a..454f4a5bac 100644 --- a/xtask/src/clippy.rs +++ b/xtask/src/clippy.rs @@ -16,42 +16,38 @@ impl Clippy { arch.install()?; let triple = arch.triple(); - cmd!(sh, "cargo clippy --target={triple}").run()?; - cmd!(sh, "cargo clippy --target={triple} --features common-os").run()?; - cmd!(sh, "cargo clippy --target={triple}") + let clippy = || cmd!(sh, "cargo clippy --target={triple}"); + + clippy().run()?; + clippy().arg("--features=common-os").run()?; + clippy() .arg("--features=acpi,dns,fsgsbase,pci,smp,vga") .run()?; - cmd!(sh, "cargo clippy --target={triple}") - .arg("--no-default-features") - .run()?; - cmd!(sh, "cargo clippy --target={triple}") - .arg("--all-features") - .run()?; - cmd!(sh, "cargo clippy --target={triple}") + clippy().arg("--no-default-features").run()?; + clippy().arg("--all-features").run()?; + clippy() .arg("--no-default-features") .arg("--features=tcp") .run()?; - cmd!(sh, "cargo clippy --target={triple}") + clippy() .arg("--no-default-features") .arg("--features=acpi,fsgsbase,pci,smp,vga") .run()?; match *arch { Arch::X86_64 => { - cmd!(sh, "cargo clippy --target={triple}") - .arg("--features=shell") - .run()?; + clippy().arg("--features=shell").run()?; } Arch::Aarch64 => {} Arch::Riscv64 => { - cmd!(sh, "cargo clippy --target={triple}") + clippy() .arg("--no-default-features") .arg("--features=gem-net,tcp") .run()?; } } - cmd!(sh, "cargo clippy --target={triple}") + clippy() .arg("--no-default-features") .arg("--features=acpi,fsgsbase,newlib,smp,vga") .run()?;