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/lint.rs | |
parent | 51019dc2674de9b4f5c3beb09c193b98fd582d25 (diff) |
fix(fmt,lint): do not print number of checked files when `--quiet` is enabled (#7579)
Diffstat (limited to 'cli/lint.rs')
-rw-r--r-- | cli/lint.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/lint.rs b/cli/lint.rs index ba159146e..7190192dc 100644 --- a/cli/lint.rs +++ b/cli/lint.rs @@ -105,6 +105,8 @@ pub async fn lint_files( pub fn print_rules_list() { let lint_rules = rules::get_recommended_rules(); + // The rules should still be printed even if `--quiet` option is enabled, + // so use `println!` here instead of `info!`. println!("Available rules:"); for rule in lint_rules { println!(" - {}", rule.code()); @@ -237,15 +239,15 @@ impl LintReporter for PrettyLintReporter { fn close(&mut self, check_count: usize) { match self.lint_count { - 1 => eprintln!("Found 1 problem"), - n if n > 1 => eprintln!("Found {} problems", self.lint_count), + 1 => info!("Found 1 problem"), + n if n > 1 => info!("Found {} problems", self.lint_count), _ => (), } match check_count { - 1 => println!("Checked 1 file"), - n if n > 1 => println!("Checked {} files", n), - _ => (), + n if n <= 1 => info!("Checked {} file", n), + n if n > 1 => info!("Checked {} files", n), + _ => unreachable!(), } } } |