mirror of
https://github.com/numtide/treefmt.git
synced 2024-09-11 17:07:44 +03:00
display formatter outputs on error
If a formatter fails with exit status > 0, print the captured outputs by default. As a user, I want to see directly what caused the error.
This commit is contained in:
parent
ff9f9601e1
commit
451c293765
@ -4,7 +4,7 @@ use crate::{expand_exe, expand_if_path, expand_path};
|
||||
use anyhow::{anyhow, Result};
|
||||
use console::style;
|
||||
use globset::{GlobBuilder, GlobSet, GlobSetBuilder};
|
||||
use log::debug;
|
||||
use log::{debug, info};
|
||||
use serde::de::{self, Visitor};
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::{fmt, path::Path, path::PathBuf, process::Command};
|
||||
@ -97,7 +97,7 @@ impl Formatter {
|
||||
match cmd.output() {
|
||||
Ok(out) => {
|
||||
if !out.status.success() {
|
||||
debug!(
|
||||
info!(
|
||||
"Error using formatter {}:\n{stdout}:\n{}\n{stderr}:\n{}",
|
||||
self.name,
|
||||
String::from_utf8_lossy(&out.stdout),
|
||||
|
Loading…
Reference in New Issue
Block a user