diff options
author | Yusuke Tanaka <yusuktan@maguro.dev> | 2020-09-20 20:49:22 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 13:49:22 +0200 |
commit | db5004f2003486aa78751a5dd5bf2989824e724e (patch) | |
tree | ed49aef1fdaa4746dff73c6c02d97a68642ed61e /cli/fmt.rs | |
parent | 51019dc2674de9b4f5c3beb09c193b98fd582d25 (diff) |
fix(fmt,lint): do not print number of checked files when `--quiet` is enabled (#7579)
Diffstat (limited to 'cli/fmt.rs')
-rw-r--r-- | cli/fmt.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/fmt.rs b/cli/fmt.rs index 2a8845290..d989ac1ad 100644 --- a/cli/fmt.rs +++ b/cli/fmt.rs @@ -78,13 +78,13 @@ async fn check_source_files( let _g = output_lock.lock().unwrap(); match diff(&file_text, &formatted_text) { Ok(diff) => { - println!(); - println!( + info!(""); + info!( "{} {}:", colors::bold("from"), file_path.display().to_string() ); - println!("{}", diff); + info!("{}", diff); } Err(e) => { eprintln!( @@ -113,7 +113,7 @@ async fn check_source_files( let checked_files_str = format!("{} {}", checked_files_count, files_str(checked_files_count)); if not_formatted_files_count == 0 { - println!("Checked {}", checked_files_str); + info!("Checked {}", checked_files_str); Ok(()) } else { let not_formatted_files_str = files_str(not_formatted_files_count); @@ -151,7 +151,7 @@ async fn format_source_files( )?; formatted_files_count.fetch_add(1, Ordering::Relaxed); let _g = output_lock.lock().unwrap(); - println!("{}", file_path.to_string_lossy()); + info!("{}", file_path.to_string_lossy()); } } Err(e) => { @@ -173,7 +173,7 @@ async fn format_source_files( ); let checked_files_count = checked_files_count.load(Ordering::Relaxed); - println!( + info!( "Checked {} {}", checked_files_count, files_str(checked_files_count) @@ -211,7 +211,7 @@ fn format_stdin(check: bool) -> Result<(), AnyError> { } fn files_str(len: usize) -> &'static str { - if len == 1 { + if len <= 1 { "file" } else { "files" |