Skip to content

Commit

Permalink
lints: move top-level lints to [workspace.lints] manifest table (#5935)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Jan 4, 2024
1 parent 17b75dd commit 9aa4409
Show file tree
Hide file tree
Showing 128 changed files with 211 additions and 145 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ default-members = ["bin/reth"]
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
resolver = "2"

[workspace.lints]
rust.missing_debug_implementations = "warn"
rust.missing_docs = "warn"
rust.unreachable_pub = "warn"
rustdoc.all = "warn"
rust.unused_must_use = "deny"
rust.rust_2018_idioms = "deny"

[workspace.package]
version = "0.1.0-alpha.13"
edition = "2021"
Expand Down
3 changes: 3 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Reth node implementation"
default-run = "reth"

[lints]
workspace = true

[package.metadata.cargo-udeps.ignore]
normal = [
# Used for diagrams in docs
Expand Down
2 changes: 2 additions & 0 deletions bin/reth/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use std::error::Error;
use vergen::EmitBuilder;

Expand Down
3 changes: 1 addition & 2 deletions bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![allow(missing_debug_implementations)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod args;
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// We use jemalloc for performance reasons
#![allow(missing_docs)]
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/optimism.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(missing_docs, rustdoc::missing_crate_level_docs)]
// We use jemalloc for performance reasons
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator]
Expand Down
3 changes: 3 additions & 0 deletions crates/blockchain-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[package.metadata.cargo-udeps.ignore]
normal = [
# Used for diagrams in docs
Expand Down
2 changes: 0 additions & 2 deletions crates/blockchain-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod blockchain_tree;
Expand Down
3 changes: 3 additions & 0 deletions crates/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
# reth
reth-network.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod config;
Expand Down
3 changes: 3 additions & 0 deletions crates/consensus/auto-seal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "A consensus impl for local testing purposes"

[lints]
workspace = true

[dependencies]
# reth
reth-beacon-consensus.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/auto-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use reth_beacon_consensus::BeaconEngineMessage;
Expand Down Expand Up @@ -42,7 +40,7 @@ use std::{
time::{SystemTime, UNIX_EPOCH},
};
use tokio::sync::{mpsc::UnboundedSender, RwLock, RwLockReadGuard, RwLockWriteGuard};
use tracing::{trace, warn};
use tracing::trace;

mod client;
mod mode;
Expand Down
1 change: 1 addition & 0 deletions crates/consensus/auto-seal/tests/it/auto_mine.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unreachable_pub)]
//! auto-mine consensus integration test

use clap::Parser;
Expand Down
3 changes: 3 additions & 0 deletions crates/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
# reth
reth-beacon-consensus-core.workspace = true
Expand Down
8 changes: 0 additions & 8 deletions crates/consensus/beacon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(
missing_debug_implementations,
missing_docs,
unused_crate_dependencies,
unreachable_pub,
rustdoc::all
)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub use reth_beacon_consensus_core::BeaconConsensus;
Expand Down
5 changes: 4 additions & 1 deletion crates/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
# reth
# reth
reth-primitives.workspace = true
reth-interfaces.workspace = true
reth-provider.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/consensus/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

/// Collection of consensus validation methods.
Expand Down
3 changes: 3 additions & 0 deletions crates/ethereum-forks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Ethereum fork types used in reth."

[lints]
workspace = true

[dependencies]
# reth
reth-codecs.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/ethereum-forks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms, unused_crate_dependencies)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

mod forkid;
Expand Down
3 changes: 3 additions & 0 deletions crates/interfaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
reth-primitives.workspace = true
reth-nippy-jar.workspace = true
Expand Down
9 changes: 1 addition & 8 deletions crates/interfaces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(
missing_debug_implementations,
missing_docs,
unused_crate_dependencies,
unreachable_pub,
rustdoc::all
)]
#![deny(unused_must_use, rust_2018_idioms)]
#![warn(unused_crate_dependencies)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

/// Consensus traits.
Expand Down
3 changes: 3 additions & 0 deletions crates/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "reth metrics utilities"

[lints]
workspace = true

[dependencies]
# reth
reth-metrics-derive.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/metrics/metrics-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[lib]
proc-macro = true

Expand Down
2 changes: 0 additions & 2 deletions crates/metrics/metrics-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use proc_macro::TokenStream;
Expand Down
2 changes: 0 additions & 2 deletions crates/metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

/// Metrics derive macro.
Expand Down
3 changes: 3 additions & 0 deletions crates/net/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Types shared across network code"

[lints]
workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/net/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod ban_list;
Expand Down
3 changes: 3 additions & 0 deletions crates/net/discv4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Ethereum network discovery"

[lints]
workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions crates/net/discv4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms, unreachable_pub, unused_crate_dependencies)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use crate::{
Expand Down Expand Up @@ -64,7 +62,7 @@ use tokio::{
time::Interval,
};
use tokio_stream::{wrappers::ReceiverStream, Stream, StreamExt};
use tracing::{debug, trace, warn};
use tracing::{debug, trace};

pub mod error;
pub mod proto;
Expand Down
3 changes: 3 additions & 0 deletions crates/net/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Support for EIP-1459 Node Discovery via DNS"

[lints]
workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions crates/net/dns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub use crate::resolver::{DnsResolver, MapResolver, Resolver};
Expand Down Expand Up @@ -47,7 +45,7 @@ use tokio_stream::{
wrappers::{ReceiverStream, UnboundedReceiverStream},
Stream, StreamExt,
};
use tracing::{debug, trace, warn};
use tracing::{debug, trace};

mod config;
mod error;
Expand Down
3 changes: 3 additions & 0 deletions crates/net/downloaders/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Implementations of various block downloaders"

[lints]
workspace = true

[dependencies]
# reth
reth-interfaces.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/net/downloaders/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

/// The collection of algorithms for downloading block bodies.
Expand Down
3 changes: 3 additions & 0 deletions crates/net/ecies/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
reth-primitives.workspace = true
reth-net-common.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/net/ecies/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod algorithm;
Expand Down
3 changes: 3 additions & 0 deletions crates/net/eth-wire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
# reth
reth-codecs.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/net/eth-wire/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod builder;
Expand Down
3 changes: 3 additions & 0 deletions crates/net/nat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage.workspace = true
repository.workspace = true
description = "Helpers for working around NAT"

[lints]
workspace = true

[dependencies]

# nat
Expand Down
Loading

0 comments on commit 9aa4409

Please sign in to comment.