Skip to content

Commit

Permalink
chore: refactor lints (#1386)
Browse files Browse the repository at this point in the history
* chore: refactor lints
* rustdoc lints
* fix doc link
  • Loading branch information
rakita authored May 7, 2024
1 parent f24bf3b commit c1109bd
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 19 deletions.
8 changes: 8 additions & 0 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ readme = "../../README.md"
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unreachable_pub = "warn"
unused_must_use = "deny"
rust_2018_idioms = "deny"

[lints.rustdoc]
all = "warn"

[dependencies]
revm-primitives = { path = "../primitives", version = "3.1.1", default-features = false }

Expand Down
4 changes: 1 addition & 3 deletions crates/interpreter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! # revm-interpreter
//!
//! REVM Interpreter.
#![warn(rustdoc::all)]
#![warn(unreachable_pub, unused_crate_dependencies)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
Expand Down
8 changes: 8 additions & 0 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ version = "6.0.0"
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unreachable_pub = "warn"
unused_must_use = "deny"
rust_2018_idioms = "deny"

[lints.rustdoc]
all = "warn"

[dependencies]
revm-primitives = { path = "../primitives", version = "3.1.1", default-features = false }
bn = { package = "substrate-bn", version = "0.6", default-features = false }
Expand Down
2 changes: 0 additions & 2 deletions crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! # revm-precompile
//!
//! Implementations of EVM precompiled contracts.
#![warn(rustdoc::all)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(not(feature = "std"), no_std)]

#[macro_use]
Expand Down
11 changes: 8 additions & 3 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ repository = "https://github.com/bluealloy/revm"
version = "3.1.1"
readme = "../../README.md"

# Don't need to run build script outside of this repo
exclude = ["build.rs", "src/kzg/*.txt"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unreachable_pub = "warn"
unused_must_use = "deny"
rust_2018_idioms = "deny"

[lints.rustdoc]
all = "warn"

[dependencies]
alloy-primitives = { version = "0.7.2", default-features = false, features = [
"rlp",
Expand Down
4 changes: 1 addition & 3 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! # revm-primitives
//!
//! EVM primitive types.
#![warn(rustdoc::all)]
#![warn(unreachable_pub, unused_crate_dependencies)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
Expand Down
18 changes: 15 additions & 3 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ readme = "../../README.md"
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unreachable_pub = "warn"
unused_must_use = "deny"
rust_2018_idioms = "deny"

[lints.rustdoc]
all = "warn"

[dependencies]
# revm
revm-interpreter = { path = "../interpreter", version = "4.0.0", default-features = false }
Expand Down Expand Up @@ -46,16 +54,20 @@ alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy.git", rev = "44b8a6
alloy-transport = { git = "https://github.com/alloy-rs/alloy.git", rev = "44b8a6d", optional = true, default-features = false }

[dev-dependencies]
alloy-sol-types = { version = "0.7.0", default-features = false, features = ["std"] }
alloy-sol-types = { version = "0.7.0", default-features = false, features = [
"std",
] }
ethers-contract = { version = "2.0.14", default-features = false }
anyhow = "1.0.82"
criterion = "0.5"
indicatif = "0.17"
reqwest = { version = "0.12" }

alloy-provider = { git = "https://github.com/alloy-rs/alloy.git", rev = "44b8a6d", default-features = false, features = ["reqwest"] }
alloy-provider = { git = "https://github.com/alloy-rs/alloy.git", rev = "44b8a6d", default-features = false, features = [
"reqwest",
] }
# needed for enabling TLS to use HTTPS connections when testing alloy DB
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy.git" , rev = "44b8a6d" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy.git", rev = "44b8a6d" }

[features]
default = ["std", "c-kzg", "secp256k1", "portable"]
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/journaled_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::vec::Vec;
pub struct JournaledState {
/// Current state.
pub state: State,
/// [EIP-1153[(https://eips.ethereum.org/EIPS/eip-1153) transient storage that is discarded after every transactions
/// [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) transient storage that is discarded after every transactions
pub transient_storage: TransientStorage,
/// logs
pub logs: Vec<Log>,
Expand Down
5 changes: 1 addition & 4 deletions crates/revm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![doc = "Revm is a Rust EVM implementation."]
#![warn(rustdoc::all, unreachable_pub)]
#![allow(rustdoc::bare_urls)]
//! Revm is a Rust EVM implementation.
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(not(feature = "std"), no_std)]

#[macro_use]
Expand Down

0 comments on commit c1109bd

Please sign in to comment.