aboutsummaryrefslogtreecommitdiff
path: root/mingling_cli/src/linter/cmd_lint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_cli/src/linter/cmd_lint.rs')
-rw-r--r--mingling_cli/src/linter/cmd_lint.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/mingling_cli/src/linter/cmd_lint.rs b/mingling_cli/src/linter/cmd_lint.rs
index 38f2973..b49605f 100644
--- a/mingling_cli/src/linter/cmd_lint.rs
+++ b/mingling_cli/src/linter/cmd_lint.rs
@@ -1,14 +1,15 @@
use crate::linter::mlint_report::{MlintReport, StateLintReports};
use cargo_metadata::Metadata;
use mingling::consts::REMAINS;
-use mingling::macros::{arg, chain, completion, dispatcher, metadata, pack, suggest};
+use mingling::macros::{arg, chain, completion, dispatcher, metadata, suggest};
use mingling::metadata::Description;
use mingling::picker::parselib::ParserStyle;
use mingling::picker::{EntryPicker, PickerArg};
+use mingling::{Grouped, Wrap};
use mingling::{LazyRes, ShellContext, Suggest};
use tokio::task::JoinSet;
-dispatcher!("lint", CMDLint => EntryLint);
+dispatcher!("lint", EntryLint);
const ARG_WITH_CHECKER: PickerArg<Option<String>> = arg![with_checker: Option<String>];
@@ -77,7 +78,8 @@ async fn linter_main(metadata: &Metadata) -> Vec<MlintReport> {
all_reports
}
-pack!(StateBeginLinter = ());
+#[derive(Grouped, Wrap)]
+pub struct StateBeginLinter(());
#[chain]
pub fn handle_lint(args: EntryLint) -> StateBeginLinter {
@@ -88,7 +90,7 @@ pub fn handle_lint(args: EntryLint) -> StateBeginLinter {
// If with_checker is not set, proceed directly to the mingling lint phase
let Some(with_checker) = with_checker else {
- return StateBeginLinter::new(());
+ return StateBeginLinter(());
};
let with_checker: Vec<&str> = with_checker.split(',').collect();
@@ -97,7 +99,7 @@ pub fn handle_lint(args: EntryLint) -> StateBeginLinter {
// Run the outer checker (e.g. cargo check) with output passed through directly
execute_checker(&with_checker, checker_args.as_slice());
- StateBeginLinter::new(())
+ StateBeginLinter(())
}
/// Run the outer checker (e.g. cargo check) with output passed through directly.
@@ -135,11 +137,11 @@ pub async fn handle_state_begin_linter(
) -> StateLintReports {
let metadata = metadata.get_ref().data();
let reports = linter_main(metadata).await;
- StateLintReports::new(reports)
+ StateLintReports(reports)
}
#[completion(EntryLint)]
-pub fn complete_lint(ctx: &ShellContext) -> Suggest {
+pub fn complete_lint(ctx: ShellContext) -> Suggest {
if mingling::picker::parselib::build_possible_flags(
ParserStyle::global_style(),
&ARG_WITH_CHECKER.into_info(),