CLI: a malformed JSON Lines entry names its step as well as its line (#3147)

Review follow-up (CodeRabbit): a line that wasn't valid JSON was reported
by its line only, while every other --commands error names the run's step.
It now says `step N (line L)`, N counted with the --cmd steps before it.
run_refuses_malformed_commands_naming_the_step expects `step 2 (line 3)`;
it fails without the change.
This commit is contained in:
Taha-Mahmoodi
2026-10-22 21:36:05 +07:00
committed by bflatastic
parent 87fdd4a370
commit 49d69d48e5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -386,7 +386,7 @@ fn parse_commands(source: &str, text: &str, first: usize) -> Result<Vec<Step>, S
if entries.len() == MAX_COMMANDS_STEPS {
return Err(too_many());
}
let v = serde_json::from_str(line).map_err(|e| format!("--commands {source}: line {}: {e}", n + 1))?;
let v = serde_json::from_str(line).map_err(|e| format!("--commands {source}: step {} (line {}): {e}", first + entries.len(), n + 1))?;
entries.push((Some(n + 1), v));
}
}