Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: adding lints to activate over time (#307)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <simon.paitrault@gmail.com>
  • Loading branch information
Freyskeyd authored and gruberb committed Sep 22, 2023
1 parent 5cf533d commit 998a681
Show file tree
Hide file tree
Showing 31 changed files with 87 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ members = [
"crates/*"
]

[workspace.lints.rust]
# Deny
missing_docs = "allow"
unused = "allow"

# Warn
deprecated-in-future = "warn"

[profile.release]
strip = true

Expand Down
3 changes: 3 additions & 0 deletions crates/topos-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-api"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[features]
default = ["grpc"]
grpc = []
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-certificate-spammer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-certificate-spammer"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
clap.workspace = true
tokio-stream.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-clock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-clock"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
tokio.workspace = true
futures.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ name = "topos-commands"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
async-trait.workspace = true
3 changes: 3 additions & 0 deletions crates/topos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-core"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-uci = { path = "../topos-uci", optional = true }
topos-api = { path = "../topos-api", optional = true }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description = "Implementation of the Topos cryptography utility functions"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
secp256k1.workspace = true
byteorder.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-metrics"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
lazy_static.workspace = true
prometheus.workspace = true
3 changes: 3 additions & 0 deletions crates/topos-p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-p2p"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
async-trait.workspace = true
bincode.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-p2p/src/behaviour/transmission/codec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{i8::MAX, io};
use std::io;

use crate::constant::{SYNCHRONIZER_PROTOCOL, TRANSMISSION_PROTOCOL};

Expand Down
3 changes: 3 additions & 0 deletions crates/topos-sequencer-subnet-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-sequencer-subnet-client"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
hex.workspace = true
serde_json.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-sequencer-subnet-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-sequencer-subnet-runtime"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
byteorder.workspace = true
hex.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-sequencer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description = "Implementation of the Topos protocol"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
hex.workspace = true
serde = { workspace = true, features = ["derive"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-api"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-p2p = { path = "../topos-p2p" }
topos-api = { path = "../topos-api", features = ["graphql"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-broadcast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-broadcast"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
byteorder.workspace = true
futures.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/topos-tce-broadcast/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use ethers::signers::{LocalWallet, Signer};
use rstest::*;
use std::collections::HashSet;
use std::time::Duration;
use std::usize;
use tce_transport::ReliableBroadcastParams;
use tokio::sync::mpsc::Receiver;
use topos_test_sdk::constants::*;
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-gatekeeper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-gatekeeper"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
async-trait.workspace = true
futures.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-proxy"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-core = { workspace = true, features = ["uci", "api"] }
topos-telemetry = { path = "../topos-telemetry" }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-storage"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-core = { workspace = true, features = ["uci", "api"] }
topos-commands = { path = "../topos-commands/" }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-synchronizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-synchronizer"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
futures.workspace = true
thiserror.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-tce-transport"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[lib]
path = 'src/lib.rs'

Expand Down
3 changes: 3 additions & 0 deletions crates/topos-tce/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ version = "0.1.0"
edition = "2021"
rust-version = "1.65"

[lints]
workspace = true

[dependencies]
async-trait.workspace = true
bincode.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-telemetry"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
opentelemetry.workspace = true
tracing-opentelemetry.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-test-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
edition = "2021"
build = "build.rs"

[lints]
workspace = true

[dependencies]
topos-core = { workspace = true, features = ["uci"] }
topos-p2p = { path = "../topos-p2p/" }
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-test-sdk/proc_macro_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "proc_macro_sdk"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[lib]
proc-macro = true

Expand Down
3 changes: 3 additions & 0 deletions crates/topos-uci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos-uci"
version = "0.1.1"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-crypto.workspace = true
ethereum-types.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/topos-uci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//!
//! Data structures to support Certificates' exchange
extern crate core;

pub use certificate::Certificate;
pub use certificate_id::CertificateId;
pub use subnet_id::SubnetId;
Expand Down
3 changes: 3 additions & 0 deletions crates/topos-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description = "Key manager"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
secp256k1.workspace = true
byteorder.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/topos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "topos"
version = "0.1.0"
edition = "2021"

[lints]
workspace = true

[dependencies]
topos-tce = { path = "../topos-tce/", optional = true }
topos-p2p = { path = "../topos-p2p" }
Expand Down
2 changes: 1 addition & 1 deletion crates/topos/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn verbose_to_level(verbose: u8) -> Level {
1 => Level::WARN,
2 => Level::INFO,
3 => Level::DEBUG,
4..=std::u8::MAX => Level::TRACE,
_ => Level::TRACE,
}
}

Expand Down

0 comments on commit 998a681

Please sign in to comment.