Skip to content

Commit 5b237e1

Browse files
committed
Rename Fix command extension example to avoid conflict
1 parent 1193a29 commit 5b237e1

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

crates/tracel-xtask/src/commands/test.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ fn push_optional_args(cmd_args: &mut Vec<String>, args: &TestCmdArgs) {
4242
cmd_args.extend(vec!["--jobs".to_string(), jobs.to_string()]);
4343
};
4444
if let Some(threads) = &args.threads {
45-
cmd_args.extend(vec!["--".to_string(), "--test-threads".to_string(), threads.to_string()]);
45+
cmd_args.extend(vec![
46+
"--".to_string(),
47+
"--test-threads".to_string(),
48+
threads.to_string(),
49+
]);
4650
};
4751
}
4852

@@ -58,7 +62,10 @@ pub fn run_unit(target: &Target, args: &TestCmdArgs) -> Result<()> {
5862
"--examples",
5963
"--color",
6064
"always",
61-
].into_iter().map(|s| s.to_string()).collect::<Vec<String>>();
65+
]
66+
.into_iter()
67+
.map(|s| s.to_string())
68+
.collect::<Vec<String>>();
6269
push_optional_args(&mut cmd_args, args);
6370
run_process_for_workspace(
6471
"cargo",
@@ -103,7 +110,10 @@ fn run_unit_test(member: &WorkspaceMember, args: &TestCmdArgs) -> Result<(), any
103110
"--color=always",
104111
"--",
105112
"--color=always",
106-
].into_iter().map(|s| s.to_string()).collect::<Vec<String>>();
113+
]
114+
.into_iter()
115+
.map(|s| s.to_string())
116+
.collect::<Vec<String>>();
107117
push_optional_args(&mut cmd_args, args);
108118
run_process_for_package(
109119
"cargo",
@@ -133,7 +143,10 @@ pub fn run_integration(target: &Target, args: &TestCmdArgs) -> anyhow::Result<()
133143
"test_*",
134144
"--color",
135145
"always",
136-
].into_iter().map(|s| s.to_string()).collect::<Vec<String>>();
146+
]
147+
.into_iter()
148+
.map(|s| s.to_string())
149+
.collect::<Vec<String>>();
137150
push_optional_args(&mut cmd_args, args);
138151
run_process_for_workspace(
139152
"cargo",
@@ -176,7 +189,10 @@ fn run_integration_test(member: &WorkspaceMember, args: &TestCmdArgs) -> Result<
176189
&member.name,
177190
"--color",
178191
"always",
179-
].into_iter().map(|s| s.to_string()).collect::<Vec<String>>();
192+
]
193+
.into_iter()
194+
.map(|s| s.to_string())
195+
.collect::<Vec<String>>();
180196
push_optional_args(&mut cmd_args, args);
181197
run_process_for_package(
182198
"cargo",

xtask/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern crate log;
1313
Coverage,
1414
Doc,
1515
Dependencies,
16+
Fix,
1617
Publish,
1718
Test,
1819
Validate,
@@ -30,7 +31,7 @@ pub enum Command {
3031
/// Example of a new command which extendeds target
3132
ExtendedTarget(commands::extended_target::ExtendedTargetCmdArgs),
3233
/// Comprehensive example of an extended Fix command with an additional target and subcommand
33-
Fix(commands::fix::ExtendedFixCmdArgs),
34+
ExtendedFix(commands::fix::ExtendedFixCmdArgs),
3435
/// Example of a new command with support of base Target
3536
MyCommand(commands::my_command::MyCommandCmdArgs),
3637
/// Example of a new command with subcommands
@@ -49,8 +50,8 @@ fn main() -> anyhow::Result<()> {
4950
Command::ExtendedCheckSubCommands(args) => {
5051
commands::extended_check_sub_commands::handle_command(args)
5152
}
53+
Command::ExtendedFix(args) => commands::fix::handle_command(args, None),
5254
Command::ExtendedTarget(args) => commands::extended_target::handle_command(args),
53-
Command::Fix(args) => commands::fix::handle_command(args, None),
5455
Command::MyCommand(args) => commands::my_command::handle_command(args),
5556
Command::MyCommandWithSubCommand(args) => {
5657
commands::my_command_with_sub_commands::handle_command(args)

0 commit comments

Comments
 (0)