mirror of
https://github.com/casey/just
synced 2024-09-06 16:55:26 +00:00
Suppress --fmt --check diff if --quiet is passed (#1457)
This commit is contained in:
parent
fbe1c4c7a3
commit
9887582497
|
@ -374,6 +374,7 @@ impl Subcommand {
|
|||
return if formatted == src {
|
||||
Ok(())
|
||||
} else {
|
||||
if !config.verbosity.quiet() {
|
||||
use similar::{ChangeTag, TextDiff};
|
||||
|
||||
let diff = TextDiff::configure()
|
||||
|
@ -391,6 +392,7 @@ impl Subcommand {
|
|||
eprint!("{}{symbol}{change}{}", color.prefix(), color.suffix());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Err(Error::FormatCheckFoundDiff)
|
||||
};
|
||||
|
|
|
@ -53,6 +53,14 @@ test! {
|
|||
status: EXIT_FAILURE,
|
||||
}
|
||||
|
||||
test! {
|
||||
name: check_found_diff_quiet,
|
||||
justfile: "x:=``\n",
|
||||
args: ("--unstable", "--fmt", "--check", "--quiet"),
|
||||
stderr: "",
|
||||
status: EXIT_FAILURE,
|
||||
}
|
||||
|
||||
test! {
|
||||
name: check_diff_color,
|
||||
justfile: "x:=``\n",
|
||||
|
|
Loading…
Reference in a new issue