Skip to content

Commit

Permalink
chore: add print_stdout/print_stderr lints to workspace level
Browse files Browse the repository at this point in the history
  • Loading branch information
oleonardolima committed May 6, 2024
1 parent 2703cc6 commit 9f69ee5
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ members = [

[workspace.package]
authors = ["Bitcoin Dev Kit Developers"]

[workspace.lints.clippy]
print_stdout = "deny"
print_stderr = "deny"
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
msrv="1.63.0"
allow-print-in-tests=true
3 changes: 3 additions & 0 deletions crates/bdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ authors = ["Bitcoin Dev Kit Developers"]
edition = "2021"
rust-version = "1.63"

[lints]
workspace = true

[dependencies]
anyhow = { version = "1", default-features = false }
rand = "^0.8"
Expand Down
1 change: 1 addition & 0 deletions crates/bdk/examples/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use bdk::{KeychainKind, Wallet};
///
/// This example demonstrates the interaction between a bdk wallet and miniscript policy.
#[allow(clippy::print_stdout)]
fn main() -> Result<(), Box<dyn Error>> {
// We start with a generic miniscript policy string
let policy_str = "or(10@thresh(4,pk(029ffbe722b147f3035c87cb1c60b9a5947dd49c774cc31e94773478711a929ac0),pk(025f05815e3a1a8a83bfbb03ce016c9a2ee31066b98f567f6227df1d76ec4bd143),pk(025625f41e4a065efc06d5019cbbd56fe8c07595af1231e7cbc03fafb87ebb71ec),pk(02a27c8b850a00f67da3499b60562673dcf5fdfb82b7e17652a7ac54416812aefd),pk(03e618ec5f384d6e19ca9ebdb8e2119e5bef978285076828ce054e55c4daf473e2)),1@and(older(4209713),thresh(2,pk(03deae92101c790b12653231439f27b8897264125ecb2f46f48278603102573165),pk(033841045a531e1adf9910a6ec279589a90b3b8a904ee64ffd692bd08a8996c1aa),pk(02aebf2d10b040eb936a6f02f44ee82f8b34f5c1ccb20ff3949c2b28206b7c1068))))";
Expand Down
2 changes: 2 additions & 0 deletions crates/bdk/examples/mnemonic_to_descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
1 change: 1 addition & 0 deletions crates/bdk/examples/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn Error>> {
let secp = bitcoin::secp256k1::Secp256k1::new();

Expand Down
3 changes: 3 additions & 0 deletions crates/bitcoind_rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
# For no-std, remember to enable the bitcoin/no-std feature
bitcoin = { version = "0.31", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions crates/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
# For no-std, remember to enable the bitcoin/no-std feature
bitcoin = { version = "0.31.0", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/chain/tests/test_local_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum ExpectedResult<'a> {
Err(CannotConnectError),
}

#[allow(clippy::print_stdout)]
impl<'a> TestLocalChain<'a> {
fn run(mut self) {
println!("[TestLocalChain] test: {}", self.name);
Expand Down
3 changes: 3 additions & 0 deletions crates/electrum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.0", default-features = false }
electrum-client = { version = "0.19" }
Expand Down
3 changes: 3 additions & 0 deletions crates/esplora/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.0", default-features = false }
esplora-client = { version = "0.7.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions crates/file_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ keywords = ["bitcoin", "persist", "persistence", "bdk", "file"]
authors = ["Bitcoin Dev Kit Developers"]
readme = "README.md"

[lints]
workspace = true

[dependencies]
anyhow = { version = "1", default-features = false }
bdk_chain = { path = "../chain", version = "0.13.0", features = [ "serde", "miniscript" ] }
Expand Down
3 changes: 3 additions & 0 deletions crates/hwi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { path = "../bdk" }
hwi = { version = "0.8.0", features = [ "miniscript"] }
3 changes: 3 additions & 0 deletions crates/persist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ authors = ["Bitcoin Dev Kit Developers"]
edition = "2021"
rust-version = "1.63"

[lints]
workspace = true

[dependencies]
anyhow = { version = "1", default-features = false }
bdk_chain = { path = "../chain", version = "0.13.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions crates/testenv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
bitcoincore-rpc = { version = "0.18" }
bdk_chain = { path = "../chain", version = "0.13", default-features = false }
Expand Down

0 comments on commit 9f69ee5

Please sign in to comment.