diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-22 22:57:35 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-22 22:57:56 +0800 |
| commit | 29009ea248ddf70698cdf90fa36b9bbb89442668 (patch) | |
| tree | 4b53cd062f1037807bf441677650de4f7a0b302d /mingling_cli/src/linter.rs | |
| parent | f73b054eaa7c0b858628d2e4ec18ca96376f4c35 (diff) | |
feat(linter): add `lint-install` subcommand for rust-analyzer setup
Diffstat (limited to 'mingling_cli/src/linter.rs')
| -rw-r--r-- | mingling_cli/src/linter.rs | 18 |
1 files changed, 10 insertions, 8 deletions
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<crate::ThisProgram>) { #[program_setup] pub fn mingling_linter_command_setup(program: &mut Program<crate::ThisProgram>) { - 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") } |
