From 6ec4b6a3ad821559eeaa8c93c45a73c72b305c6e Mon Sep 17 00:00:00 2001 From: Daniel Knopik <107140945+dknopik@users.noreply.github.com> Date: Mon, 16 Dec 2024 06:11:25 +0100 Subject: [PATCH] Enforce alphabetically ordered cargo deps (#71) Co-authored-by: Mac L --- .github/workflows/test-suite.yml | 15 +++++++++++++++ Cargo.toml | 12 ++++++------ anchor/Cargo.toml | 6 +++--- anchor/client/Cargo.toml | 25 ++++++++++++------------- anchor/common/ssv_types/Cargo.toml | 6 +++--- anchor/common/version/Cargo.toml | 2 +- anchor/http_api/Cargo.toml | 4 ++-- anchor/http_metrics/Cargo.toml | 4 ++-- anchor/network/Cargo.toml | 16 ++++++++-------- anchor/processor/Cargo.toml | 10 +++++----- anchor/qbft/Cargo.toml | 4 ++-- 11 files changed, 59 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index ca6e98a..8877949 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -192,3 +192,18 @@ jobs: # cache-target: release # - name: Run Makefile to trigger the bash script # run: make cli + cargo-sort: + name: cargo-sort + needs: [check-labels] + if: needs.check-labels.outputs.skip_ci != 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get latest version of stable Rust + uses: moonrepo/setup-rust@v1 + with: + channel: stable + cache-target: release + bins: cargo-sort + - name: Run cargo sort to check if Cargo.toml files are sorted + run: cargo sort --check --workspace diff --git a/Cargo.toml b/Cargo.toml index 8fd1fda..aa1e61d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,13 +3,13 @@ members = [ "anchor", "anchor/client", + "anchor/common/ssv_types", "anchor/common/version", "anchor/http_api", "anchor/http_metrics", "anchor/network", "anchor/processor", "anchor/qbft", - "anchor/common/ssv_types", ] resolver = "2" @@ -21,11 +21,11 @@ client = { path = "anchor/client" } qbft = { path = "anchor/qbft" } http_api = { path = "anchor/http_api" } http_metrics = { path = "anchor/http_metrics" } -network = { path ="anchor/network"} -version = { path ="anchor/common/version"} +network = { path = "anchor/network" } +version = { path = "anchor/common/version" } processor = { path = "anchor/processor" } ssv_types = { path = "anchor/common/ssv_types" } -lighthouse_network = { git = "https://github.com/sigp/lighthouse", branch = "unstable"} +lighthouse_network = { git = "https://github.com/sigp/lighthouse", branch = "unstable" } task_executor = { git = "https://github.com/sigp/lighthouse", branch = "unstable", default-features = false, features = [ "tracing", ] } metrics = { git = "https://github.com/agemanning/lighthouse", branch = "modularize-vc" } validator_metrics = { git = "https://github.com/agemanning/lighthouse", branch = "modularize-vc" } @@ -36,12 +36,12 @@ types = { git = "https://github.com/sigp/lighthouse", branch = "unstable" } derive_more = { version = "1.0.0", features = ["full"] } async-channel = "1.9" axum = "0.7.7" -clap = { version = "4.5.15", features = ["derive", "wrap_help"]} +clap = { version = "4.5.15", features = ["derive", "wrap_help"] } discv5 = "0.8.0" dirs = "5.0.1" either = "1.13.0" futures = "0.3.30" -tower-http = {version = "0.6", features = ["cors"] } +tower-http = { version = "0.6", features = ["cors"] } hyper = "1.4" num_cpus = "1" parking_lot = "0.12" diff --git a/anchor/Cargo.toml b/anchor/Cargo.toml index 1c9dd15..7cbea88 100644 --- a/anchor/Cargo.toml +++ b/anchor/Cargo.toml @@ -6,16 +6,16 @@ authors = ["Sigma Prime "] rust-version = "1.81.0" [dependencies] -task_executor = { workspace = true } -sensitive_url = { workspace = true } async-channel = { workspace = true } clap = { workspace = true } +client = { workspace = true } dirs = { workspace = true } futures = { workspace = true } +sensitive_url = { workspace = true } serde = { workspace = true } +task_executor = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } -client = { workspace = true } tracing-subscriber = { workspace = true } [dev-dependencies] diff --git a/anchor/client/Cargo.toml b/anchor/client/Cargo.toml index 2b1e53e..dfb3c40 100644 --- a/anchor/client/Cargo.toml +++ b/anchor/client/Cargo.toml @@ -9,22 +9,21 @@ name = "client" path = "src/lib.rs" [dependencies] -task_executor = { workspace = true } -http_api = { workspace = true } -version = { workspace = true } -http_metrics = { workspace = true } clap = { workspace = true } -serde = { workspace = true } -strum = { workspace = true } -sensitive_url = { workspace = true } dirs = { workspace = true } +ethereum_hashing = "0.7.0" +fdlimit = "0.3" +http_api = { workspace = true } +http_metrics = { workspace = true } hyper = { workspace = true } -tracing = { workspace = true } network = { workspace = true } -unused_port = { workspace = true } -tokio = { workspace = true } parking_lot = { workspace = true } processor = { workspace = true } -# Local dependencies -fdlimit = "0.3" -ethereum_hashing = "0.7.0" +sensitive_url = { workspace = true } +serde = { workspace = true } +strum = { workspace = true } +task_executor = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } +unused_port = { workspace = true } +version = { workspace = true } diff --git a/anchor/common/ssv_types/Cargo.toml b/anchor/common/ssv_types/Cargo.toml index 1d6b713..5741ce1 100644 --- a/anchor/common/ssv_types/Cargo.toml +++ b/anchor/common/ssv_types/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } authors = ["Sigma Prime "] [dependencies] -types = { workspace = true} -openssl = { workspace = true } -derive_more = { workspace = true } base64 = { workspace = true } +derive_more = { workspace = true } +openssl = { workspace = true } +types = { workspace = true } diff --git a/anchor/common/version/Cargo.toml b/anchor/common/version/Cargo.toml index a893e3c..6ab3a7a 100644 --- a/anchor/common/version/Cargo.toml +++ b/anchor/common/version/Cargo.toml @@ -8,4 +8,4 @@ git-version = "0.3.9" target_info = "0.1.0" [dev-dependencies] -regex = "1.11" \ No newline at end of file +regex = "1.11" diff --git a/anchor/http_api/Cargo.toml b/anchor/http_api/Cargo.toml index 9873a81..7769bf0 100644 --- a/anchor/http_api/Cargo.toml +++ b/anchor/http_api/Cargo.toml @@ -9,9 +9,9 @@ name = "http_api" path = "src/lib.rs" [dependencies] -task_executor = { workspace = true } axum = { workspace = true } -slot_clock = { workspace = true } serde = { workspace = true } +slot_clock = { workspace = true } +task_executor = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } diff --git a/anchor/http_metrics/Cargo.toml b/anchor/http_metrics/Cargo.toml index 7048b70..fbf931c 100644 --- a/anchor/http_metrics/Cargo.toml +++ b/anchor/http_metrics/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] axum = { workspace = true } +metrics = { workspace = true } parking_lot = { workspace = true } serde = { workspace = true } +tokio = { workspace = true } tower-http = { workspace = true } tracing = { workspace = true } -tokio = { workspace = true } validator_metrics = { workspace = true } -metrics = { workspace = true } # Group dependencies warp_utils = { git = "https://github.com/agemanning/lighthouse", branch = "modularize-vc" } diff --git a/anchor/network/Cargo.toml b/anchor/network/Cargo.toml index 73801a6..b3b9946 100644 --- a/anchor/network/Cargo.toml +++ b/anchor/network/Cargo.toml @@ -5,16 +5,16 @@ edition = { workspace = true } authors = ["Sigma Prime "] [dependencies] -tokio = { workspace = true } -libp2p = { version = "0.54", default-features = false, features = ["identify", "yamux", "noise", "secp256k1", "tcp", "tokio", "macros", "gossipsub", "quic", "ping"] } -futures = { workspace = true } -task_executor = { workspace = true } -version = { workspace = true } -lighthouse_network = { workspace = true} +dirs = { workspace = true } discv5 = { workspace = true } -dirs = { workspace = true } +futures = { workspace = true } +libp2p = { version = "0.54", default-features = false, features = ["identify", "yamux", "noise", "secp256k1", "tcp", "tokio", "macros", "gossipsub", "quic", "ping"] } +lighthouse_network = { workspace = true } serde = { workspace = true } +task_executor = { workspace = true } +tokio = { workspace = true } tracing = { workspace = true } +version = { workspace = true } [dev-dependencies] -async-channel = { workspace = true } \ No newline at end of file +async-channel = { workspace = true } diff --git a/anchor/processor/Cargo.toml b/anchor/processor/Cargo.toml index c0e5c01..c81984c 100644 --- a/anchor/processor/Cargo.toml +++ b/anchor/processor/Cargo.toml @@ -5,13 +5,13 @@ authors = ["Sigma Prime