diff --git a/Cargo.toml b/Cargo.toml index 1c29bbaf5d..1256dd2ccc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,3 +21,7 @@ members = [ [workspace.package] authors = ["Bitcoin Dev Kit Developers"] + +[workspace.lints.clippy] +print_stdout = "deny" +print_stderr = "deny" diff --git a/clippy.toml b/clippy.toml index e3b99604d8..80ade4e700 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1,2 @@ -msrv="1.63.0" \ No newline at end of file +msrv="1.63.0" +allow-print-in-tests=true diff --git a/crates/bitcoind_rpc/Cargo.toml b/crates/bitcoind_rpc/Cargo.toml index bee58efa12..09a76b6faf 100644 --- a/crates/bitcoind_rpc/Cargo.toml +++ b/crates/bitcoind_rpc/Cargo.toml @@ -12,6 +12,9 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] bitcoin = { version = "0.32.0", default-features = false } bitcoincore-rpc = { version = "0.19.0" } diff --git a/crates/chain/Cargo.toml b/crates/chain/Cargo.toml index 7261bdfa25..0651e71806 100644 --- a/crates/chain/Cargo.toml +++ b/crates/chain/Cargo.toml @@ -12,6 +12,9 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] bitcoin = { version = "0.32.0", default-features = false } serde = { version = "1", optional = true, features = ["derive", "rc"] } diff --git a/crates/chain/tests/test_local_chain.rs b/crates/chain/tests/test_local_chain.rs index 6819e3da15..cb4ee93515 100644 --- a/crates/chain/tests/test_local_chain.rs +++ b/crates/chain/tests/test_local_chain.rs @@ -32,6 +32,7 @@ enum ExpectedResult<'a> { Err(CannotConnectError), } +#[allow(clippy::print_stdout)] impl<'a> TestLocalChain<'a> { fn run(mut self) { println!("[TestLocalChain] test: {}", self.name); diff --git a/crates/electrum/Cargo.toml b/crates/electrum/Cargo.toml index eff11daac6..489d35a5c4 100644 --- a/crates/electrum/Cargo.toml +++ b/crates/electrum/Cargo.toml @@ -9,6 +9,9 @@ description = "Fetch data from electrum in the form BDK accepts" license = "MIT OR Apache-2.0" readme = "README.md" +[lints] +workspace = true + [dependencies] bdk_chain = { path = "../chain", version = "0.17.0" } electrum-client = { version = "0.21", features = ["proxy"], default-features = false } diff --git a/crates/esplora/Cargo.toml b/crates/esplora/Cargo.toml index 9148a0f86f..422cf99fb2 100644 --- a/crates/esplora/Cargo.toml +++ b/crates/esplora/Cargo.toml @@ -11,6 +11,9 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] bdk_chain = { path = "../chain", version = "0.17.0", default-features = false } esplora-client = { version = "0.9.0", default-features = false } diff --git a/crates/file_store/Cargo.toml b/crates/file_store/Cargo.toml index 3e4c11d0ce..50f86c5b8d 100644 --- a/crates/file_store/Cargo.toml +++ b/crates/file_store/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["bitcoin", "persist", "persistence", "bdk", "file"] authors = ["Bitcoin Dev Kit Developers"] readme = "README.md" +[lints] +workspace = true + [dependencies] bdk_chain = { path = "../chain", version = "0.17.0", features = [ "serde", "miniscript" ] } bincode = { version = "1" } diff --git a/crates/hwi/Cargo.toml b/crates/hwi/Cargo.toml index b4ae39fe94..154833f1e1 100644 --- a/crates/hwi/Cargo.toml +++ b/crates/hwi/Cargo.toml @@ -8,6 +8,9 @@ description = "Utilities to use bdk with hardware wallets" license = "MIT OR Apache-2.0" readme = "README.md" +[lints] +workspace = true + [dependencies] bdk_wallet = { path = "../wallet", version = "1.0.0-beta.1" } hwi = { version = "0.9.0", features = [ "miniscript"] } diff --git a/crates/testenv/Cargo.toml b/crates/testenv/Cargo.toml index 2d9c26caab..48fa1f6b09 100644 --- a/crates/testenv/Cargo.toml +++ b/crates/testenv/Cargo.toml @@ -12,6 +12,9 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] bdk_chain = { path = "../chain", version = "0.17", default-features = false } electrsd = { version = "0.28.0", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] } diff --git a/crates/wallet/Cargo.toml b/crates/wallet/Cargo.toml index 44314a9687..aa35317090 100644 --- a/crates/wallet/Cargo.toml +++ b/crates/wallet/Cargo.toml @@ -12,6 +12,9 @@ authors = ["Bitcoin Dev Kit Developers"] edition = "2021" rust-version = "1.63" +[lints] +workspace = true + [dependencies] rand_core = { version = "0.6.0" } miniscript = { version = "12.0.0", features = ["serde"], default-features = false } diff --git a/crates/wallet/examples/compiler.rs b/crates/wallet/examples/compiler.rs index 72bed012e7..d0922fa4ee 100644 --- a/crates/wallet/examples/compiler.rs +++ b/crates/wallet/examples/compiler.rs @@ -31,6 +31,7 @@ use bdk_wallet::{KeychainKind, Wallet}; /// /// This example demonstrates the interaction between a bdk wallet and miniscript policy. +#[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { // We start with a miniscript policy string let policy_str = "or( diff --git a/crates/wallet/examples/mnemonic_to_descriptors.rs b/crates/wallet/examples/mnemonic_to_descriptors.rs index 76c53cf292..978c57af32 100644 --- a/crates/wallet/examples/mnemonic_to_descriptors.rs +++ b/crates/wallet/examples/mnemonic_to_descriptors.rs @@ -19,6 +19,8 @@ use std::str::FromStr; /// This example demonstrates how to generate a mnemonic phrase /// using BDK and use that to generate a descriptor string. + +#[allow(clippy::print_stdout)] fn main() -> Result<(), anyhow::Error> { let secp = Secp256k1::new(); diff --git a/crates/wallet/examples/policy.rs b/crates/wallet/examples/policy.rs index 6e0c826905..e64d47b53e 100644 --- a/crates/wallet/examples/policy.rs +++ b/crates/wallet/examples/policy.rs @@ -26,6 +26,7 @@ use bdk_wallet::signer::SignersContainer; /// This example demos a Policy output for a 2of2 multisig between between 2 parties, where the wallet holds /// one of the Extend Private key. +#[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { let secp = bitcoin::secp256k1::Secp256k1::new();