Skip to content

Commit 370eae4

Browse files
committed
style: apply cargo fmt formatting
Fixes CI formatting check failure by applying automatic formatting to studio-cli-manager/src/lib.rs. Breaks up long lines and formats arrays to be one item per line for better readability.
1 parent 584b37a commit 370eae4

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

studio-cli-manager/src/lib.rs

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ impl CliManager {
123123
operation = operation_parts.join(".");
124124

125125
// Extract common parameters that might be useful for cache invalidation
126-
if let Some(pipeline_idx) = args.iter().position(|&arg| arg == "--pipeline" || arg == "-p") {
126+
if let Some(pipeline_idx) = args
127+
.iter()
128+
.position(|&arg| arg == "--pipeline" || arg == "-p")
129+
{
127130
if let Some(pipeline_id) = args.get(pipeline_idx + 1) {
128131
parameters.insert("pipeline_id".to_string(), pipeline_id.to_string());
129132
}
@@ -136,7 +139,10 @@ impl CliManager {
136139
}
137140

138141
// For commands like "plm pipeline create my-pipeline", extract the pipeline name
139-
if operation_parts.len() >= 3 && operation_parts[0] == "plm" && operation_parts[1] == "pipeline" {
142+
if operation_parts.len() >= 3
143+
&& operation_parts[0] == "plm"
144+
&& operation_parts[1] == "pipeline"
145+
{
140146
if let Some(pipeline_name) = operation_parts.get(3) {
141147
parameters.insert("pipeline_name".to_string(), pipeline_name.to_string());
142148
}
@@ -148,12 +154,30 @@ impl CliManager {
148154
/// Check if an operation is a write operation that should trigger cache invalidation
149155
fn is_write_operation(operation: &str) -> bool {
150156
let write_operations = [
151-
"create", "update", "delete", "start", "stop", "cancel", "complete",
152-
"assign", "revoke", "lock", "unlock", "import", "export", "deploy",
153-
"install", "uninstall", "enable", "disable", "restart"
157+
"create",
158+
"update",
159+
"delete",
160+
"start",
161+
"stop",
162+
"cancel",
163+
"complete",
164+
"assign",
165+
"revoke",
166+
"lock",
167+
"unlock",
168+
"import",
169+
"export",
170+
"deploy",
171+
"install",
172+
"uninstall",
173+
"enable",
174+
"disable",
175+
"restart",
154176
];
155177

156-
write_operations.iter().any(|&write_op| operation.contains(write_op))
178+
write_operations
179+
.iter()
180+
.any(|&write_op| operation.contains(write_op))
157181
}
158182

159183
/// Execute a CLI command
@@ -164,15 +188,16 @@ impl CliManager {
164188
) -> Result<serde_json::Value> {
165189
let cli_path = self.ensure_cli(None).await?;
166190
let result = self.executor.execute(&cli_path, args, working_dir).await?;
167-
191+
168192
// Extract operation information for hooks
169193
let (operation, _parameters) = Self::extract_operation_info(args);
170-
194+
171195
// Only trigger hooks for write operations
172196
if Self::is_write_operation(&operation) {
173-
self.trigger_operation_hooks(&operation, args, &result).await;
197+
self.trigger_operation_hooks(&operation, args, &result)
198+
.await;
174199
}
175-
200+
176201
Ok(result)
177202
}
178203

0 commit comments

Comments
 (0)