diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-08 22:45:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 22:45:06 -0400 |
commit | 47f7bed677a6b72e873712de8f3988ea891710e4 (patch) | |
tree | 096549459b479cf1383e65c87b77e9f9482df258 /cli/tools/test | |
parent | e6dc4dfbff25e77d2127591802229b4a74037d24 (diff) |
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate.
2. I very often accidentally commit `eprintln`s.
When we should use `println` or `eprintln`, it's not too bad to be a bit
more verbose and ignore the lint rule.
Diffstat (limited to 'cli/tools/test')
-rw-r--r-- | cli/tools/test/channel.rs | 2 | ||||
-rw-r--r-- | cli/tools/test/mod.rs | 2 | ||||
-rw-r--r-- | cli/tools/test/reporters/dot.rs | 2 | ||||
-rw-r--r-- | cli/tools/test/reporters/tap.rs | 2 |
4 files changed, 8 insertions, 0 deletions
diff --git a/cli/tools/test/channel.rs b/cli/tools/test/channel.rs index 780a17de6..a8ce7a955 100644 --- a/cli/tools/test/channel.rs +++ b/cli/tools/test/channel.rs @@ -442,6 +442,8 @@ impl TestEventSender { } } +#[allow(clippy::print_stdout)] +#[allow(clippy::print_stderr)] #[cfg(test)] mod tests { use super::*; diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 94541cf06..94d4caee0 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -1518,6 +1518,8 @@ pub async fn report_tests( &tests, &test_steps, ); + + #[allow(clippy::print_stderr)] if let Err(err) = reporter.flush_report(&elapsed, &tests, &test_steps) { eprint!("Test reporter failed to flush: {}", err) } diff --git a/cli/tools/test/reporters/dot.rs b/cli/tools/test/reporters/dot.rs index d2e529a9c..854ef9666 100644 --- a/cli/tools/test/reporters/dot.rs +++ b/cli/tools/test/reporters/dot.rs @@ -11,6 +11,7 @@ pub struct DotTestReporter { summary: TestSummary, } +#[allow(clippy::print_stdout)] impl DotTestReporter { pub fn new(cwd: Url) -> DotTestReporter { let console_width = if let Some(size) = crate::util::console::console_size() @@ -80,6 +81,7 @@ fn fmt_cancelled() -> String { colors::gray("!").to_string() } +#[allow(clippy::print_stdout)] impl TestReporter for DotTestReporter { fn report_register(&mut self, _description: &TestDescription) {} diff --git a/cli/tools/test/reporters/tap.rs b/cli/tools/test/reporters/tap.rs index 0758686f0..6dc690e6b 100644 --- a/cli/tools/test/reporters/tap.rs +++ b/cli/tools/test/reporters/tap.rs @@ -22,6 +22,7 @@ pub struct TapTestReporter { step_results: HashMap<usize, Vec<(TestStepDescription, TestStepResult)>>, } +#[allow(clippy::print_stdout)] impl TapTestReporter { pub fn new(cwd: Url, is_concurrent: bool) -> TapTestReporter { TapTestReporter { @@ -113,6 +114,7 @@ impl TapTestReporter { } } +#[allow(clippy::print_stdout)] impl TestReporter for TapTestReporter { fn report_register(&mut self, _description: &TestDescription) {} |