Skip to content

Commit

Permalink
run cargo machete in CI and fail if there are unused deps (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
spatten authored Sep 7, 2023
1 parent 4eb643a commit 7441476
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 119 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,31 @@ jobs:
with:
tool: sqlx-cli
- run: '! make migration-status | grep -q pending'

# Ensure all deps are used
unused-deps:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: cargo-machete

# If you're here because CI is flagging a dependency as unused,
# but it really is used, you can add an exception!
#
# https://github.com/bnjbvr/cargo-machete#false-positives
#
# If it is unused, you can fix it by installing and running machete:
#
# cargo binstall cargo-machete
# cargo machete --fix
- run: cargo machete
117 changes: 0 additions & 117 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ url = "2.4.0"
base64 = "0.21.2"
itertools = "0.10.5"
time = { version = "0.3.22", features = ["parsing"] }
yaque = "0.6.4"
reqwest = { version = "0.11.18", features = ["rustls-tls"], default-features = false }
zip = "0.6.6"
bytes = "1.4.0"
Expand All @@ -59,7 +58,6 @@ atty = "0.2.14"
serde_json = "1.0.96"
cached = "0.43.0"
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }
duplicate = "1.0.0"
aho-corasick = "0.7.20"
regex = "1.9.3"
srclib = { git = "https://github.com/fossas/foundation-libs" }
Expand Down

0 comments on commit 7441476

Please sign in to comment.