diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0b293da8d..1c159dea1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,6 +27,10 @@ jobs: uses: baptiste0928/cargo-install@v1 with: crate: cargo-hack + - name: Install cargo-machete + uses: baptiste0928/cargo-install@v1 + with: + crate: cargo-machete - name: Install Protoc uses: arduino/setup-protoc@v1 with: @@ -34,6 +38,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Check fmt run: cargo fmt -- --check + - name: Check unused dependencies + run: cargo machete - name: Check features run: cargo hack check --all --ignore-private --each-feature --no-dev-deps - name: Check all targets diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 6c776d57f..0e37b420c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -293,3 +293,6 @@ tower-http = { version = "0.3", optional = true } [build-dependencies] tonic-build = { path = "../tonic-build", features = ["prost"] } + +[package.metadata.cargo-machete] +ignored = ["prost-types"] diff --git a/interop/Cargo.toml b/interop/Cargo.toml index bc975e632..f7b4c42d8 100644 --- a/interop/Cargo.toml +++ b/interop/Cargo.toml @@ -35,3 +35,6 @@ tracing-subscriber = {version = "0.3", features = ["env-filter"]} [build-dependencies] tonic-build = {path = "../tonic-build", features = ["prost"]} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/ambiguous_methods/Cargo.toml b/tests/ambiguous_methods/Cargo.toml index d0d193ae5..03f4c55b4 100644 --- a/tests/ambiguous_methods/Cargo.toml +++ b/tests/ambiguous_methods/Cargo.toml @@ -14,3 +14,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/compression/Cargo.toml b/tests/compression/Cargo.toml index 5d1010b83..43e64b140 100644 --- a/tests/compression/Cargo.toml +++ b/tests/compression/Cargo.toml @@ -21,3 +21,6 @@ tower-http = {version = "0.3", features = ["map-response-body", "map-request-bod [build-dependencies] tonic-build = {path = "../../tonic-build" } + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/disable_comments/Cargo.toml b/tests/disable_comments/Cargo.toml index c694fc01d..949068758 100644 --- a/tests/disable_comments/Cargo.toml +++ b/tests/disable_comments/Cargo.toml @@ -15,3 +15,6 @@ tonic = { path = "../../tonic" } [build-dependencies] prost-build = "0.11.6" tonic-build = { path = "../../tonic-build" } + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/extern_path/my_application/Cargo.toml b/tests/extern_path/my_application/Cargo.toml index a2eeb6bbc..d30f62ce1 100644 --- a/tests/extern_path/my_application/Cargo.toml +++ b/tests/extern_path/my_application/Cargo.toml @@ -15,3 +15,6 @@ uuid = {package = "uuid1", path = "../uuid"} [build-dependencies] tonic-build = {path = "../../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/extern_path/uuid/Cargo.toml b/tests/extern_path/uuid/Cargo.toml index df1e49716..694e08014 100644 --- a/tests/extern_path/uuid/Cargo.toml +++ b/tests/extern_path/uuid/Cargo.toml @@ -12,3 +12,6 @@ version = "0.1.0" prost = "0.11" [build-dependencies] prost-build = "0.11.6" + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/included_service/Cargo.toml b/tests/included_service/Cargo.toml index 77469fa6f..b7e4d72c6 100644 --- a/tests/included_service/Cargo.toml +++ b/tests/included_service/Cargo.toml @@ -14,3 +14,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/integration_tests/Cargo.toml b/tests/integration_tests/Cargo.toml index e52d1c619..d9c20b5f5 100644 --- a/tests/integration_tests/Cargo.toml +++ b/tests/integration_tests/Cargo.toml @@ -29,3 +29,6 @@ tracing-subscriber = {version = "0.3", features = ["env-filter"]} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/same_name/Cargo.toml b/tests/same_name/Cargo.toml index e2c69a7a8..b336c28dd 100644 --- a/tests/same_name/Cargo.toml +++ b/tests/same_name/Cargo.toml @@ -14,3 +14,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/service_named_result/Cargo.toml b/tests/service_named_result/Cargo.toml index 1730235e1..f254baea3 100644 --- a/tests/service_named_result/Cargo.toml +++ b/tests/service_named_result/Cargo.toml @@ -12,3 +12,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/service_named_service/Cargo.toml b/tests/service_named_service/Cargo.toml index be97922ab..3bb4e5cee 100644 --- a/tests/service_named_service/Cargo.toml +++ b/tests/service_named_service/Cargo.toml @@ -14,3 +14,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/stream_conflict/Cargo.toml b/tests/stream_conflict/Cargo.toml index 866cba9d6..f651409b6 100644 --- a/tests/stream_conflict/Cargo.toml +++ b/tests/stream_conflict/Cargo.toml @@ -14,3 +14,6 @@ tonic = { path = "../../tonic" } [build-dependencies] tonic-build = { path = "../../tonic-build" } + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/wellknown-compiled/Cargo.toml b/tests/wellknown-compiled/Cargo.toml index 60842b4ec..4fb67261a 100644 --- a/tests/wellknown-compiled/Cargo.toml +++ b/tests/wellknown-compiled/Cargo.toml @@ -18,3 +18,6 @@ tonic = {path = "../../tonic"} [build-dependencies] prost-build = "0.11.6" tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost"] diff --git a/tests/wellknown/Cargo.toml b/tests/wellknown/Cargo.toml index 194316e2f..efe0f4c9b 100644 --- a/tests/wellknown/Cargo.toml +++ b/tests/wellknown/Cargo.toml @@ -15,3 +15,6 @@ tonic = {path = "../../tonic"} [build-dependencies] tonic-build = {path = "../../tonic-build"} + +[package.metadata.cargo-machete] +ignored = ["prost", "prost-types"]