From d6d01a3b628d199e59821da62da549f660b43b8f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 28 Oct 2024 11:41:09 -0400 Subject: [PATCH] Adding cargo shear (#5139) * Adding cargo shear (fail check) * Running cargo shear. * Fixing another missing. * Removing cargo-machete in favor of cargo-shear --- .woodpecker.yml | 6 +++--- Cargo.lock | 2 -- crates/api_common/Cargo.toml | 2 +- crates/api_crud/Cargo.toml | 2 +- crates/apub/Cargo.toml | 1 - crates/db_schema/Cargo.toml | 3 --- crates/db_views_actor/Cargo.toml | 3 --- crates/utils/Cargo.toml | 4 +++- 8 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index cb6580e32..a2124c1cc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -73,12 +73,12 @@ steps: when: - event: pull_request - cargo_machete: + cargo_shear: image: *rust_nightly_image commands: - *install_binstall - - cargo binstall -y cargo-machete - - cargo machete + - cargo binstall -y cargo-shear + - cargo shear when: - event: pull_request diff --git a/Cargo.lock b/Cargo.lock index 3cfec53eb..491b7cc94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2570,7 +2570,6 @@ dependencies = [ "futures", "html2md", "html2text", - "http 1.1.0", "itertools 0.13.0", "lemmy_api_common", "lemmy_db_schema", @@ -2815,7 +2814,6 @@ dependencies = [ "markdown-it-sup", "pretty_assertions", "regex", - "reqwest 0.12.8", "reqwest-middleware", "rosetta-build", "rosetta-i18n", diff --git a/crates/api_common/Cargo.toml b/crates/api_common/Cargo.toml index 4eabfe5f9..f939985e8 100644 --- a/crates/api_common/Cargo.toml +++ b/crates/api_common/Cargo.toml @@ -72,7 +72,7 @@ jsonwebtoken = { version = "9.3.0", optional = true } # necessary for wasmt compilation getrandom = { version = "0.2.15", features = ["js"] } -[package.metadata.cargo-machete] +[package.metadata.cargo-shear] ignored = ["getrandom"] [dev-dependencies] diff --git a/crates/api_crud/Cargo.toml b/crates/api_crud/Cargo.toml index 2793beac3..723864705 100644 --- a/crates/api_crud/Cargo.toml +++ b/crates/api_crud/Cargo.toml @@ -34,5 +34,5 @@ serde_json = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } -[package.metadata.cargo-machete] +[package.metadata.cargo-shear] ignored = ["futures"] diff --git a/crates/apub/Cargo.toml b/crates/apub/Cargo.toml index 660489a68..55eadeaf9 100644 --- a/crates/apub/Cargo.toml +++ b/crates/apub/Cargo.toml @@ -33,7 +33,6 @@ tokio = { workspace = true } tracing = { workspace = true } strum = { workspace = true } url = { workspace = true } -http = { workspace = true } futures = { workspace = true } itertools = { workspace = true } uuid = { workspace = true } diff --git a/crates/db_schema/Cargo.toml b/crates/db_schema/Cargo.toml index aeaa55c93..c9b2a7930 100644 --- a/crates/db_schema/Cargo.toml +++ b/crates/db_schema/Cargo.toml @@ -82,6 +82,3 @@ derive-new.workspace = true [dev-dependencies] serial_test = { workspace = true } pretty_assertions = { workspace = true } - -[package.metadata.cargo-machete] -ignored = ["strum"] diff --git a/crates/db_views_actor/Cargo.toml b/crates/db_views_actor/Cargo.toml index c29b7d66d..d623959d5 100644 --- a/crates/db_views_actor/Cargo.toml +++ b/crates/db_views_actor/Cargo.toml @@ -48,6 +48,3 @@ pretty_assertions = { workspace = true } url.workspace = true lemmy_db_views.workspace = true lemmy_utils.workspace = true - -[package.metadata.cargo-machete] -ignored = ["strum"] diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 1c99e89c2..c22f863c1 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -49,6 +49,9 @@ full = [ "dep:markdown-it", ] +[package.metadata.cargo-shear] +ignored = ["http"] + [dependencies] regex = { workspace = true, optional = true } tracing = { workspace = true, optional = true } @@ -88,7 +91,6 @@ markdown-it-sup = "1.0.0" markdown-it-ruby = "1.0.0" [dev-dependencies] -reqwest = { workspace = true } pretty_assertions = { workspace = true } [build-dependencies]