Skip to content

Commit

Permalink
style: check for unused dependencies using cargo-udeps (#10433)
Browse files Browse the repository at this point in the history
As evidenced by some of the changes, we have been pulling in a couple of
dependencies that aren’t being used in code in any way. While that does
not affect the runtime (dead crates don’t even get looked at by rustc,)
it very much so does affect the compile times.

One unfortunate part of this check is that running it forces a `cargo
check` of the entire worktree. That’s not ideal (and would be great if
there was an easy way to combine it with some other work,) but it might
do for now?
  • Loading branch information
nagisa committed Jan 16, 2024
1 parent 279a1ce commit 4770aa3
Show file tree
Hide file tree
Showing 61 changed files with 167 additions and 267 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: cargo-llvm-cov
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: cargo-udeps

# Setup the dependency rust cache and llvm-cov
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
Expand Down Expand Up @@ -295,6 +298,19 @@ jobs:
crate: just
- run: just check-non-default

check_udeps:
name: "Unused dependencies"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: just
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: cargo-udeps
- run: just check-udeps

cargo_audit:
name: "Cargo Audit"
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 4770aa3

Please sign in to comment.