From 90d39f4cc1b04a1fe9d5f38a7ced12330d32cf6c Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Tue, 12 Sep 2023 11:28:15 +0800 Subject: [PATCH] lint: allow `print_stdout` and `print_stderr` --- benches/capture/src/main.rs | 1 + crates/cargo-platform/examples/matches.rs | 2 ++ crates/cargo-test-support/src/lib.rs | 2 ++ crates/mdman/src/main.rs | 2 ++ crates/resolver-tests/src/lib.rs | 2 ++ crates/semver-check/src/main.rs | 2 ++ crates/xtask-build-man/src/main.rs | 2 ++ crates/xtask-stale-label/src/main.rs | 2 ++ credential/cargo-credential-1password/src/main.rs | 1 + credential/cargo-credential-macos-keychain/src/lib.rs | 2 ++ credential/cargo-credential/examples/stdout-redirected.rs | 3 +++ credential/cargo-credential/src/lib.rs | 3 +++ tests/testsuite/main.rs | 2 ++ 13 files changed, 26 insertions(+) diff --git a/benches/capture/src/main.rs b/benches/capture/src/main.rs index f0e670b31c9a..dcded3b1a3a8 100644 --- a/benches/capture/src/main.rs +++ b/benches/capture/src/main.rs @@ -5,6 +5,7 @@ //! The workspace will be saved in a `.tgz` file in the `../workspaces` directory. #![allow(clippy::disallowed_methods)] +#![allow(clippy::print_stderr)] use flate2::{Compression, GzBuilder}; use std::fs; diff --git a/crates/cargo-platform/examples/matches.rs b/crates/cargo-platform/examples/matches.rs index 1b438fb110a3..11318a7df554 100644 --- a/crates/cargo-platform/examples/matches.rs +++ b/crates/cargo-platform/examples/matches.rs @@ -1,6 +1,8 @@ //! This example demonstrates how to filter a Platform based on the current //! host target. +#![allow(clippy::print_stdout)] + use cargo_platform::{Cfg, Platform}; use std::process::Command; use std::str::FromStr; diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs index 60a406d601f1..0b35d8367ce1 100644 --- a/crates/cargo-test-support/src/lib.rs +++ b/crates/cargo-test-support/src/lib.rs @@ -3,6 +3,8 @@ //! See for a guide on writing tests. #![allow(clippy::disallowed_methods)] +#![allow(clippy::print_stderr)] +#![allow(clippy::print_stdout)] use std::env; use std::ffi::OsStr; diff --git a/crates/mdman/src/main.rs b/crates/mdman/src/main.rs index facaa5120476..3c09bc4dd83f 100644 --- a/crates/mdman/src/main.rs +++ b/crates/mdman/src/main.rs @@ -1,3 +1,5 @@ +#![allow(clippy::print_stderr)] + use anyhow::{bail, format_err, Context, Error}; use mdman::{Format, ManMap}; use std::collections::HashMap; diff --git a/crates/resolver-tests/src/lib.rs b/crates/resolver-tests/src/lib.rs index 65adfb733a0d..71385ccdd095 100644 --- a/crates/resolver-tests/src/lib.rs +++ b/crates/resolver-tests/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::print_stderr)] + use std::cell::RefCell; use std::cmp::PartialEq; use std::cmp::{max, min}; diff --git a/crates/semver-check/src/main.rs b/crates/semver-check/src/main.rs index 9ea0d1244a00..edcf59957e4b 100644 --- a/crates/semver-check/src/main.rs +++ b/crates/semver-check/src/main.rs @@ -13,6 +13,8 @@ //! - `dont-deny`: By default tests have a `#![deny(warnings)]`. This option //! avoids this attribute. Note that `#![allow(unused)]` is always added. +#![allow(clippy::print_stderr)] + use std::error::Error; use std::fs; use std::path::Path; diff --git a/crates/xtask-build-man/src/main.rs b/crates/xtask-build-man/src/main.rs index 6680c3783cca..2ab3f098aaa4 100644 --- a/crates/xtask-build-man/src/main.rs +++ b/crates/xtask-build-man/src/main.rs @@ -10,6 +10,8 @@ //! For more, read their doc comments. //! ``` +#![allow(clippy::print_stderr)] + use std::fs; use std::io; use std::path::PathBuf; diff --git a/crates/xtask-stale-label/src/main.rs b/crates/xtask-stale-label/src/main.rs index 88c044b5b962..efcb52d01c1f 100644 --- a/crates/xtask-stale-label/src/main.rs +++ b/crates/xtask-stale-label/src/main.rs @@ -10,6 +10,8 @@ //! Probably autofix them in the future. //! ``` +#![allow(clippy::print_stderr)] + use std::fmt::Write as _; use std::path::PathBuf; use std::process; diff --git a/credential/cargo-credential-1password/src/main.rs b/credential/cargo-credential-1password/src/main.rs index c5b0228e92a2..3e98e1588800 100644 --- a/credential/cargo-credential-1password/src/main.rs +++ b/credential/cargo-credential-1password/src/main.rs @@ -1,6 +1,7 @@ //! Cargo registry 1password credential process. #![allow(clippy::disallowed_methods)] +#![allow(clippy::print_stderr)] use cargo_credential::{ Action, CacheControl, Credential, CredentialResponse, Error, RegistryInfo, Secret, diff --git a/credential/cargo-credential-macos-keychain/src/lib.rs b/credential/cargo-credential-macos-keychain/src/lib.rs index 9e6d55472e09..8a702a3620c6 100644 --- a/credential/cargo-credential-macos-keychain/src/lib.rs +++ b/credential/cargo-credential-macos-keychain/src/lib.rs @@ -1,5 +1,7 @@ //! Cargo registry macos keychain credential process. +#![allow(clippy::print_stderr)] + #[cfg(target_os = "macos")] mod macos { use cargo_credential::{ diff --git a/credential/cargo-credential/examples/stdout-redirected.rs b/credential/cargo-credential/examples/stdout-redirected.rs index 75a2d16d1eba..fb7c0446cf85 100644 --- a/credential/cargo-credential/examples/stdout-redirected.rs +++ b/credential/cargo-credential/examples/stdout-redirected.rs @@ -1,5 +1,8 @@ //! Provider used for testing redirection of stdout. +#![allow(clippy::print_stderr)] +#![allow(clippy::print_stdout)] + use cargo_credential::{Action, Credential, CredentialResponse, Error, RegistryInfo}; struct MyCredential; diff --git a/credential/cargo-credential/src/lib.rs b/credential/cargo-credential/src/lib.rs index 60bce65be543..0888fb402f79 100644 --- a/credential/cargo-credential/src/lib.rs +++ b/credential/cargo-credential/src/lib.rs @@ -37,6 +37,9 @@ #![doc = include_str!("../examples/file-provider.rs")] //! ``` +#![allow(clippy::print_stderr)] +#![allow(clippy::print_stdout)] + use serde::{Deserialize, Serialize}; use std::{fmt::Display, io}; use time::OffsetDateTime; diff --git a/tests/testsuite/main.rs b/tests/testsuite/main.rs index 2d2515751bee..a5edd28de7f1 100644 --- a/tests/testsuite/main.rs +++ b/tests/testsuite/main.rs @@ -1,4 +1,6 @@ #![allow(clippy::disallowed_methods)] +#![allow(clippy::print_stderr)] +#![allow(clippy::print_stdout)] #[macro_use] extern crate cargo_test_macro;