mirror of
https://github.com/numtide/treefmt.git
synced 2024-09-11 17:07:44 +03:00
create match on formatter output
This commit is contained in:
parent
c3512d12b6
commit
d3ade342bd
@ -221,7 +221,6 @@ pub fn run_treefmt(
|
||||
}
|
||||
Err(err) => {
|
||||
// FIXME: What is the right behaviour if a formatter has failed running?
|
||||
// error!("{} failed: {}", &formatter, err);
|
||||
// Assume the paths were not formatted
|
||||
return Err(anyhow!("{} failed: {}", &formatter, err));
|
||||
}
|
||||
|
@ -98,7 +98,11 @@ impl Formatter {
|
||||
// Append all of the file paths to format.
|
||||
cmd_arg.args(paths);
|
||||
// And run
|
||||
Ok(cmd_arg.output()?)
|
||||
match cmd_arg.output() {
|
||||
Ok(out) => Ok(out),
|
||||
Err(err) => Err(anyhow!("formatting error due to {}", err))
|
||||
}
|
||||
// Ok(cmd_arg.output()?)
|
||||
}
|
||||
|
||||
/// Returns the formatter if the path matches the formatter rules.
|
||||
|
Loading…
Reference in New Issue
Block a user