From 4cd21c171ccf0e3a978d7977a5169dbc89f34152 Mon Sep 17 00:00:00 2001 From: Leonardo Lima Date: Sun, 5 May 2024 12:24:33 -0300 Subject: [PATCH] chore: add `print_stdout`/`print_stderr` lints to workspace level --- Cargo.toml | 4 ++++ clippy.toml | 2 +- crates/bitcoind_rpc/Cargo.toml | 3 +++ crates/chain/Cargo.toml | 3 +++ crates/chain/tests/test_local_chain.rs | 1 - crates/electrum/Cargo.toml | 3 +++ crates/esplora/Cargo.toml | 3 +++ crates/file_store/Cargo.toml | 3 +++ crates/hwi/Cargo.toml | 3 +++ crates/testenv/Cargo.toml | 3 +++ crates/wallet/Cargo.toml | 3 +++ crates/wallet/examples/mnemonic_to_descriptors.rs | 1 + 12 files changed, 30 insertions(+), 2 deletions(-) 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..69478ceabd 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv="1.63.0" \ No newline at end of file +msrv="1.63.0" 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..23e7d3ebc2 100644 --- a/crates/chain/tests/test_local_chain.rs +++ b/crates/chain/tests/test_local_chain.rs @@ -34,7 +34,6 @@ enum ExpectedResult<'a> { impl<'a> TestLocalChain<'a> { fn run(mut self) { - println!("[TestLocalChain] test: {}", self.name); let got_changeset = match self.chain.apply_update(self.update) { Ok(changeset) => changeset, Err(got_err) => { 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/mnemonic_to_descriptors.rs b/crates/wallet/examples/mnemonic_to_descriptors.rs index 76c53cf292..bba2475188 100644 --- a/crates/wallet/examples/mnemonic_to_descriptors.rs +++ b/crates/wallet/examples/mnemonic_to_descriptors.rs @@ -19,6 +19,7 @@ use std::str::FromStr; /// This example demonstrates how to generate a mnemonic phrase /// using BDK and use that to generate a descriptor string. + fn main() -> Result<(), anyhow::Error> { let secp = Secp256k1::new();