Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add format checker to .toml #13968

Merged
merged 7 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ jobs:
with:
skip: "*.json"

check-toml:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run dprint
uses: dprint/[email protected]
with:
config-path: dprint.json

grafana:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
34 changes: 8 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ revm-inspectors = "0.14.1"
alloy-chains = { version = "0.1.32", default-features = false }
alloy-dyn-abi = "0.8.15"
alloy-eip2124 = { version = "0.1.0", default-features = false }
alloy-primitives = { version = "0.8.15", default-features = false, features = [
"map-foldhash",
] }
alloy-primitives = { version = "0.8.15", default-features = false, features = ["map-foldhash"] }
alloy-rlp = { version = "0.3.10", default-features = false }
alloy-sol-types = "0.8.15"
alloy-trie = { version = "0.7", default-features = false }
Expand All @@ -444,14 +442,10 @@ alloy-json-rpc = { version = "0.9.2", default-features = false }
alloy-network = { version = "0.9.2", default-features = false }
alloy-network-primitives = { version = "0.9.2", default-features = false }
alloy-node-bindings = { version = "0.9.2", default-features = false }
alloy-provider = { version = "0.9.2", features = [
"reqwest",
], default-features = false }
alloy-provider = { version = "0.9.2", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.9.2", default-features = false }
alloy-rpc-client = { version = "0.9.2", default-features = false }
alloy-rpc-types = { version = "0.9.2", features = [
"eth",
], default-features = false }
alloy-rpc-types = { version = "0.9.2", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.9.2", default-features = false }
alloy-rpc-types-anvil = { version = "0.9.2", default-features = false }
alloy-rpc-types-beacon = { version = "0.9.2", default-features = false }
Expand All @@ -465,9 +459,7 @@ alloy-serde = { version = "0.9.2", default-features = false }
alloy-signer = { version = "0.9.2", default-features = false }
alloy-signer-local = { version = "0.9.2", default-features = false }
alloy-transport = { version = "0.9.2" }
alloy-transport-http = { version = "0.9.2", features = [
"reqwest-rustls-tls",
], default-features = false }
alloy-transport-http = { version = "0.9.2", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.9.2", default-features = false }
alloy-transport-ws = { version = "0.9.2", default-features = false }

Expand All @@ -482,10 +474,7 @@ op-alloy-rpc-jsonrpsee = { version = "0.9.6", default-features = false }
# misc
aquamarine = "0.6"
auto_impl = "1"
backon = { version = "1.2", default-features = false, features = [
"std-blocking-sleep",
"tokio-sleep",
] }
backon = { version = "1.2", default-features = false, features = ["std-blocking-sleep", "tokio-sleep"] }
bincode = "1.3"
bitflags = "2.4"
blake3 = "1.5.5"
Expand All @@ -504,13 +493,9 @@ humantime-serde = "1.1"
itertools = { version = "0.13", default-features = false }
linked_hash_set = "0.1"
modular-bitfield = "0.11.2"
notify = { version = "6.1.1", default-features = false, features = [
"macos_fsevent",
] }
notify = { version = "6.1.1", default-features = false, features = ["macos_fsevent"] }
nybbles = { version = "0.3.0", default-features = false }
once_cell = { version = "1.19", default-features = false, features = [
"critical-section",
] }
once_cell = { version = "1.19", default-features = false, features = ["critical-section"] }
parking_lot = "0.12"
paste = "1.0"
rand = "0.8.5"
Expand Down Expand Up @@ -584,10 +569,7 @@ proptest-arbitrary-interop = "0.1.0"
# crypto
enr = { version = "0.12.1", default-features = false }
k256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
secp256k1 = { version = "0.29", default-features = false, features = [
"global-context",
"recovery",
] }
secp256k1 = { version = "0.29", default-features = false, features = ["global-context", "recovery"] }

# for eip-4844
c-kzg = "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build]
pre-build = [
# rust-bindgen dependencies: llvm-dev libclang-dev (>= 5.0) clang (>= 5.0)
"apt-get update && apt-get install --assume-yes --no-install-recommends llvm-dev libclang-6.0-dev clang-6.0"
"apt-get update && apt-get install --assume-yes --no-install-recommends llvm-dev libclang-6.0-dev clang-6.0",
]

[build.env]
passthrough = [
"JEMALLOC_SYS_WITH_LG_PAGE",
]
]
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,32 @@ ensure-codespell:
exit 1; \
fi

# Lint and format all TOML files in the project using dprint.
# This target ensures that TOML files follow consistent formatting rules,
# such as using spaces instead of tabs, and enforces other style guidelines
# defined in the dprint configuration file (e.g., dprint.json).
#
# Usage:
# make lint-toml
#
# Dependencies:
# - ensure-dprint: Ensures that dprint is installed and available in the system.
lint-toml: ensure-dprint
dprint fmt

ensure-dprint:
@if ! command -v dprint &> /dev/null; then \
echo "dprint not found. Please install it by running the command `cargo install --locked dprint` or refer to the following link for more information: https://github.com/dprint/dprint" \
exit 1; \
fi

lint:
make fmt && \
make lint-reth && \
make lint-op-reth && \
make lint-other-targets && \
make lint-codespell
make lint-codespell && \
make lint-toml

fix-lint-reth:
cargo +nightly clippy \
Expand Down
26 changes: 8 additions & 18 deletions bin/reth-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ reth-primitives-traits.workspace = true
reth-tracing.workspace = true

# alloy
alloy-provider = { workspace = true, features = [
"engine-api",
"reqwest-rustls-tls",
], default-features = false }
alloy-provider = { workspace = true, features = ["engine-api", "reqwest-rustls-tls"], default-features = false }
alloy-rpc-types-engine.workspace = true
alloy-transport.workspace = true
alloy-transport-http.workspace = true
Expand All @@ -40,9 +37,7 @@ alloy-eips.workspace = true
alloy-primitives.workspace = true

# reqwest
reqwest = { workspace = true, default-features = false, features = [
"rustls-tls-native-roots",
] }
reqwest = { workspace = true, default-features = false, features = ["rustls-tls-native-roots"] }

# tower
tower.workspace = true
Expand All @@ -54,12 +49,7 @@ tracing.workspace = true
serde.workspace = true

# async
tokio = { workspace = true, features = [
"sync",
"macros",
"time",
"rt-multi-thread",
] }
tokio = { workspace = true, features = ["sync", "macros", "time", "rt-multi-thread"] }
futures.workspace = true
async-trait.workspace = true

Expand All @@ -78,14 +68,14 @@ reth-tracing.workspace = true
default = ["jemalloc"]

asm-keccak = [
"reth-primitives/asm-keccak",
"reth-node-core/asm-keccak",
"alloy-primitives/asm-keccak"
"reth-primitives/asm-keccak",
"reth-node-core/asm-keccak",
"alloy-primitives/asm-keccak",
]

jemalloc = [
"reth-cli-util/jemalloc",
"reth-node-core/jemalloc"
"reth-cli-util/jemalloc",
"reth-node-core/jemalloc",
]
jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
tracy-allocator = ["reth-cli-util/tracy-allocator"]
Expand Down
17 changes: 6 additions & 11 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ tracing.workspace = true
serde_json.workspace = true

# async
tokio = { workspace = true, features = [
"sync",
"macros",
"time",
"rt-multi-thread",
] }
tokio = { workspace = true, features = ["sync", "macros", "time", "rt-multi-thread"] }
futures.workspace = true

# misc
Expand All @@ -102,9 +97,9 @@ default = ["jemalloc"]
dev = ["reth-cli-commands/arbitrary"]

asm-keccak = [
"reth-node-core/asm-keccak",
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak"
"reth-node-core/asm-keccak",
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak",
]

jemalloc = [
Expand All @@ -113,8 +108,8 @@ jemalloc = [
"reth-node-metrics/jemalloc",
]
jemalloc-prof = [
"reth-cli-util/jemalloc",
"reth-cli-util/jemalloc-prof"
"reth-cli-util/jemalloc",
"reth-cli-util/jemalloc-prof",
]
tracy-allocator = ["reth-cli-util/tracy-allocator"]

Expand Down
8 changes: 4 additions & 4 deletions book/sources/exex/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ version = "0.1.0"
edition = "2021"

[dependencies]
reth = { git = "https://github.com/paradigmxyz/reth.git" } # Reth
reth-exex = { git = "https://github.com/paradigmxyz/reth.git" } # Execution Extensions
reth = { git = "https://github.com/paradigmxyz/reth.git" } # Reth
reth-exex = { git = "https://github.com/paradigmxyz/reth.git" } # Execution Extensions
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git" } # Ethereum Node implementation
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git" } # Logging
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git" } # Logging

eyre = "0.6" # Easy error handling
eyre = "0.6" # Easy error handling
futures-util = "0.3" # Stream utilities for consuming notifications
4 changes: 1 addition & 3 deletions book/sources/exex/remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ edition = "2021"
[dependencies]
# reth
reth = { git = "https://github.com/paradigmxyz/reth.git" }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", features = [
"serde",
] }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", features = ["serde"] }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git" }
Expand Down
8 changes: 3 additions & 5 deletions book/sources/exex/tracking-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ edition = "2021"

[dependencies]
reth = { git = "https://github.com/paradigmxyz/reth.git" }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", features = [
"serde",
] }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", features = ["serde"] }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git" }

eyre = "0.6" # Easy error handling
futures-util = "0.3" # Stream utilities for consuming notifications
eyre = "0.6" # Easy error handling
futures-util = "0.3" # Stream utilities for consuming notifications
alloy-primitives = "0.8.7"
40 changes: 20 additions & 20 deletions crates/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ alloy-genesis.workspace = true
[features]
default = ["std"]
std = [
"alloy-chains/std",
"alloy-eips/std",
"alloy-genesis/std",
"alloy-primitives/std",
"alloy-trie/std",
"reth-primitives-traits/std",
"alloy-consensus/std",
"alloy-rlp/std",
"reth-ethereum-forks/std",
"derive_more/std",
"reth-network-peers/std",
"serde_json/std"
"alloy-chains/std",
"alloy-eips/std",
"alloy-genesis/std",
"alloy-primitives/std",
"alloy-trie/std",
"reth-primitives-traits/std",
"alloy-consensus/std",
"alloy-rlp/std",
"reth-ethereum-forks/std",
"derive_more/std",
"reth-network-peers/std",
"serde_json/std",
]
arbitrary = [
"alloy-chains/arbitrary",
"reth-ethereum-forks/arbitrary",
"reth-primitives-traits/arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"alloy-trie/arbitrary"
"alloy-chains/arbitrary",
"reth-ethereum-forks/arbitrary",
"reth-primitives-traits/arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"alloy-trie/arbitrary",
]
test-utils = [
"reth-primitives-traits/test-utils",
"reth-primitives-traits/test-utils",
]
4 changes: 0 additions & 4 deletions crates/cli/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repository.workspace = true
[lints]
workspace = true


[dependencies]
# reth
reth-cli-runner.workspace = true
Expand All @@ -22,6 +21,3 @@ clap.workspace = true
shellexpand.workspace = true
eyre.workspace = true
serde_json.workspace = true



10 changes: 2 additions & 8 deletions crates/cli/commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ serde.workspace = true
serde_json.workspace = true
tracing.workspace = true
backon.workspace = true
secp256k1 = { workspace = true, features = [
"global-context",
"rand-std",
"recovery",
] }
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }

# io
fdlimit.workspace = true
Expand All @@ -81,9 +77,7 @@ toml = { workspace = true, features = ["display"] }
# tui
comfy-table = "7.0"
crossterm = "0.28.0"
ratatui = { version = "0.28", default-features = false, features = [
"crossterm",
] }
ratatui = { version = "0.28", default-features = false, features = ["crossterm"] }

# reth test-vectors
proptest = { workspace = true, optional = true }
Expand Down
14 changes: 7 additions & 7 deletions crates/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ rand.workspace = true
[features]
default = ["std"]
std = [
"alloy-consensus/std",
"alloy-eips/std",
"alloy-primitives/std",
"reth-chainspec/std",
"reth-consensus/std",
"reth-primitives-traits/std",
"reth-primitives/std"
"alloy-consensus/std",
"alloy-eips/std",
"alloy-primitives/std",
"reth-chainspec/std",
"reth-consensus/std",
"reth-primitives-traits/std",
"reth-primitives/std",
]
Loading
Loading