aboutsummaryrefslogtreecommitdiff
path: root/mingling_ci/src/task/cmd_clippy_check.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-19 05:54:00 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-19 06:15:20 +0800
commitec9edc294fd5e7e29977fc7b0e6fb953422bc0e2 (patch)
treebbf89ef4457b8de8a8a9bca5668045d612d27572 /mingling_ci/src/task/cmd_clippy_check.rs
parent06dfc27194c11e1d1033c292c759a1c5d82e780b (diff)
chore: reorganize dev tools into dev/ directory and consolidate configs
Move CI, dev tools, and configs from root-level scattered locations into a unified `dev/` directory structure. Update all references across build scripts, documentation, and editor configurations. Also consolidate editor config generation into build.rs for automated synchronization of rust-analyzer settings across VS Code and Zed.
Diffstat (limited to 'mingling_ci/src/task/cmd_clippy_check.rs')
-rw-r--r--mingling_ci/src/task/cmd_clippy_check.rs50
1 files changed, 0 insertions, 50 deletions
diff --git a/mingling_ci/src/task/cmd_clippy_check.rs b/mingling_ci/src/task/cmd_clippy_check.rs
deleted file mode 100644
index a0dd46e..0000000
--- a/mingling_ci/src/task/cmd_clippy_check.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-check")]
-pub async fn clippy_check(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-Check", "Clippy", tasks).await;
- ResultClippyCheck { fail_count }.to_chain()
-}
-
-/// `cargo clippy --manifest-path <path> -- -D warnings`
-fn clippy_args(path: &Path) -> Vec<OsString> {
- 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 ResultClippyCheck {
- pub fail_count: usize,
-}
-
-/// Silently sets a non-zero exit code when any clippy check failed.
-#[renderer(buffer)]
-pub fn render_clippy_check(r: ResultClippyCheck, exit_code: &mut ResExitCode) {
- if r.fail_count > 0 {
- exit_code.exit_code = 1;
- }
-}