fix(oxfmt): print trailing newline for --list-different (#27773)

Fixed that last entry does not have newline, which fails pipe operation.
This commit is contained in:
leaysgur committed 2026-10-16 04:04:04 +00:00
1 parent fddf422904
commit 28eb4a752b
1 file changed
+3 -5
+3 -5
View File
@@ -211,10 +211,7 @@ impl WalkRunner {
let warning_theme =
matches!(format_mode, OutputMode::Check).then(GraphicalTheme::default);
let mut output = String::new();
for (idx, (path, elapsed)) in changed_paths.into_iter().enumerate() {
if idx != 0 {
output.push('\n');
}
for (path, elapsed) in changed_paths {
match &warning_theme {
// Style per line, some log viewers reset ANSI state on line breaks
Some(theme) => theme.write_warning(&mut output, &path).unwrap(),
@@ -223,6 +220,7 @@ impl WalkRunner {
if let Some(elapsed) = elapsed {
write!(output, " ({}ms)", elapsed.as_millis()).unwrap();
}
output.push('\n');
}
utils::print_and_flush(stdout, &output);
}
@@ -289,7 +287,7 @@ impl WalkRunner {
CliRunResult::FormatSucceeded
}
(OutputMode::Check, _) => {
utils::print_and_flush(stdout, "\n\n");
utils::print_and_flush(stdout, "\n");
utils::print_and_flush(
stdout,
&format!(