From 29009ea248ddf70698cdf90fa36b9bbb89442668 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 22 Jul 2026 22:57:35 +0800 Subject: feat(linter): add `lint-install` subcommand for rust-analyzer setup --- mingling_cli/src/linter.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'mingling_cli/src/linter.rs') diff --git a/mingling_cli/src/linter.rs b/mingling_cli/src/linter.rs index c85afc1..5d20900 100644 --- a/mingling_cli/src/linter.rs +++ b/mingling_cli/src/linter.rs @@ -4,11 +4,15 @@ use mingling::{ }; use crate::{ - linter::cmd_mlint::{CMDMinglingLinter, EntryMinglingLinter}, + linter::{ + cmd_mlint::{CMDLint, EntryLint}, + cmd_mlint_install::CMDLintInstall, + }, metadata::setup::ResUsingJson, }; pub mod cmd_mlint; +pub mod cmd_mlint_install; pub mod mlint_attr; pub mod mlint_report; @@ -19,7 +23,8 @@ pub fn mingling_linter_setup(program: &mut Program) { #[program_setup] pub fn mingling_linter_command_setup(program: &mut Program) { - program.with_dispatcher(CMDMinglingLinter); + program.with_dispatcher(CMDLint); + program.with_dispatcher(CMDLintInstall); program.with_dispatcher(CMDLinterSupportRustAnalyzer); program.with_dispatcher(CMDLinterSupportRustAnalyzerWithClippy); program.with_dispatcher(CMDLinterSupportRustAnalyzerWithCheck); @@ -40,10 +45,7 @@ dispatcher!("ra-lint", ); #[chain] -pub fn handle_ra_lint( - _: EntryLinterSupportRustAnalyzer, - use_json: &mut ResUsingJson, -) -> EntryMinglingLinter { +pub fn handle_ra_lint(_: EntryLinterSupportRustAnalyzer, use_json: &mut ResUsingJson) -> EntryLint { use_json.using = true; entry!("--message-format=json") } @@ -52,7 +54,7 @@ pub fn handle_ra_lint( pub fn handle_ra_lint_check( _: EntryLinterSupportRustAnalyzerWithCheck, use_json: &mut ResUsingJson, -) -> EntryMinglingLinter { +) -> EntryLint { use_json.using = true; entry!("--message-format=json", "--with-checker=cargo,check") } @@ -61,7 +63,7 @@ pub fn handle_ra_lint_check( pub fn handle_ra_lint_clippy( _: EntryLinterSupportRustAnalyzerWithClippy, use_json: &mut ResUsingJson, -) -> EntryMinglingLinter { +) -> EntryLint { use_json.using = true; entry!("--message-format=json", "--with-checker=cargo,clippy") } -- cgit