From b1102be2682feb2d2182ead0fcc7ce12f8d0c865 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 18 Aug 2026 11:09:23 +0800 Subject: refactor(mingling_ci): rename build, clippy, and docs commands to -check suffix --- mingling_ci/src/task/cmd_clippy.rs | 50 -------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 mingling_ci/src/task/cmd_clippy.rs (limited to 'mingling_ci/src/task/cmd_clippy.rs') diff --git a/mingling_ci/src/task/cmd_clippy.rs b/mingling_ci/src/task/cmd_clippy.rs deleted file mode 100644 index 7256bef..0000000 --- a/mingling_ci/src/task/cmd_clippy.rs +++ /dev/null @@ -1,50 +0,0 @@ -use std::ffi::OsString; -use std::path::Path; - -use mingling::{ - Grouped, Routable, - macros::{buffer, command, renderer}, - res::ResExitCode, -}; - -use crate::Next; -use crate::res::Manifests; -use crate::task::run::{location, run_parallel_checks}; - -#[command(node = "clippy-all")] -pub async fn clippy_all(manifests: &Manifests) -> Next { - let tasks = manifests - .package_dirs - .iter() - .map(|(name, path)| (name.clone(), location(path), clippy_args(path))) - .collect(); - let fail_count = run_parallel_checks("Clippy-All", "Clippy", tasks).await; - ResultClippyAll { fail_count }.to_chain() -} - -/// `cargo clippy --manifest-path -- -D warnings` -fn clippy_args(path: &Path) -> Vec { - vec![ - "cargo".into(), - "clippy".into(), - "--manifest-path".into(), - path.as_os_str().to_os_string(), - "--".into(), - "-D".into(), - "warnings".into(), - ] -} - -/// Number of packages that failed clippy. -#[derive(Grouped)] -pub struct ResultClippyAll { - pub fail_count: usize, -} - -/// Silently sets a non-zero exit code when any clippy check failed. -#[renderer(buffer)] -pub fn render_clippy_all(r: ResultClippyAll, exit_code: &mut ResExitCode) { - if r.fail_count > 0 { - exit_code.exit_code = 1; - } -} -- cgit