Skip to content

Commit

Permalink
chore: switch from udeps to machete (#178)
Browse files Browse the repository at this point in the history
Seems like machete much faster and catches more stuff (see examples
below).

Note: machete uses a regex basically, so there might be false-positives
down the line, if this happens add:

```
[package.metadata.cargo-machete]
ignored = ["package_that_machete_thinks_isnt_being_used"]
```

Co-Authored-By: Gilad Chase <gilad@starkware.com>
  • Loading branch information
giladchase and Gilad Chase authored May 28, 2024
1 parent fcdf7ae commit 6c89c0d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 28 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,9 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo test

udeps:
unused-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-12
- uses: Swatinem/rust-cache@v2
- name: Install udeps, should be cached unless `Cargo.{toml.lock}` or this workflow change
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-udeps
- name: Run udeps (detect unused dependencies)
run: cargo udeps
- name: Run Machete (detect unused dependencies)
uses: bnjbvr/cargo-machete@main
8 changes: 0 additions & 8 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions crates/gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ testing = []
axum.workspace = true
blockifier.workspace = true
cairo-lang-starknet-classes.workspace = true
clap.workspace = true
hyper.workspace = true
mempool_infra = { path = "../mempool_infra", version = "0.0" }
papyrus_config.workspace = true
Expand All @@ -27,7 +26,6 @@ starknet_mempool_types = { path = "../mempool_types", version = "0.0" }
thiserror.workspace = true
tokio.workspace = true
tower.workspace = true
url.workspace = true
validator.workspace = true

[dev-dependencies]
Expand Down
3 changes: 0 additions & 3 deletions crates/mempool_infra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ workspace = true

[dependencies]
async-trait.workspace = true
clap.workspace = true
serde.workspace = true
serde_json.workspace = true
papyrus_config.workspace = true
thiserror.workspace = true
tokio.workspace = true

[dev-dependencies]
assert_matches.workspace = true
pretty_assertions.workspace = true

4 changes: 0 additions & 4 deletions crates/mempool_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ license.workspace = true
workspace = true

[dependencies]
async-trait.workspace = true
clap.workspace = true
const_format.workspace = true
starknet_gateway = { path = "../gateway", version = "0.0" }
serde.workspace = true
serde_json.workspace = true
starknet_api.workspace = true
thiserror.workspace = true
papyrus_config.workspace = true
tokio.workspace = true
validator.workspace = true
Expand Down

0 comments on commit 6c89c0d

Please sign in to comment.