diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-17 05:49:19 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-17 05:49:19 +0800 |
| commit | 57c53affe3542cb6bd4e79ee4c18f20a1bd76b2d (patch) | |
| tree | 1cd4aef44cb7a45a8cd9d520b598f5f181e24c76 /mingling_cli/src/linter/cmd_lint.rs | |
| parent | ef23cd944402939605c78a4a853ef6e33af02c21 (diff) | |
refactor!: replace pack! macros with derive-based pipeline types
Remove the `pack!`, `pack_err!`, `pack_structural!`, and
`pack_err_structural!` macros, replacing all pipeline type definitions
with `#[derive(Grouped)]` and `#[derive(Grouped, Wrap)]` attributes.
This changes the generated struct shape from named-field structs with an
`inner` field to tuple structs accessed via `.0`, and removes the
auto-generated `name` and `info` fields from error types.
Diffstat (limited to 'mingling_cli/src/linter/cmd_lint.rs')
| -rw-r--r-- | mingling_cli/src/linter/cmd_lint.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mingling_cli/src/linter/cmd_lint.rs b/mingling_cli/src/linter/cmd_lint.rs index 07c18c5..7cab63a 100644 --- a/mingling_cli/src/linter/cmd_lint.rs +++ b/mingling_cli/src/linter/cmd_lint.rs @@ -1,10 +1,11 @@ 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; @@ -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,7 +137,7 @@ 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)] |
