Skip to content

Commit 597a54b

Browse files
authored
chore: Add cargo-machete to detect unused dependencies (#817)
1 parent 6ddef5e commit 597a54b

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.github/workflows/continuous-integration-workflow.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ jobs:
5050
# args: --workspace --all-targets
5151
# toolchain: stable
5252

53+
machete:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: checkout
57+
uses: actions/checkout@v3
58+
with:
59+
submodules: recursive
60+
- name: install toolchain
61+
uses: dtolnay/rust-toolchain@stable
62+
- name: Install cargo-machete
63+
uses: baptiste0928/cargo-install@v1
64+
with:
65+
crate: cargo-machete
66+
- name: Check unused dependencies
67+
run: cargo machete
68+
5369
test:
5470
runs-on: ${{ matrix.os }}
5571
strategy:

conformance/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ edition = "2018"
1111
[dependencies]
1212
bytes = "1"
1313
env_logger = { version = "0.8", default-features = false }
14-
log = "0.4"
1514
prost = { path = ".." }
1615
protobuf = { path = "../protobuf" }
1716
tests = { path = "../tests" }

prost-types/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ default = ["std"]
2222
std = ["prost/std"]
2323

2424
[dependencies]
25-
bytes = { version = "1", default-features = false }
2625
prost = { version = "0.11.6", path = "..", default-features = false, features = ["prost-derive"] }
2726

2827
[dev-dependencies]

protobuf/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ publish = false
99
edition = "2018"
1010

1111
[dependencies]
12-
bytes = { version = "1", default-features = false }
1312
prost = { path = ".." }
1413
prost-types = { path = "../prost-types" }
1514

@@ -39,3 +38,6 @@ bench = false
3938
[[bench]]
4039
name = "dataset"
4140
harness = false
41+
42+
[package.metadata.cargo-machete]
43+
ignored = ["prost-types"]

0 commit comments

Comments
 (0)