Browse Source

Add a `cargo machete` CI step (#5171)

`cargo machete` looks for unused dependencies
pull/5180/head
Emil Ernerfeldt 1 month ago
committed by GitHub
parent
commit
a72ebbeafc
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      .github/workflows/cargo_machete.yml
  2. 2
      Cargo.lock
  3. 1
      RELEASES.md
  4. 1
      crates/egui-winit/Cargo.toml
  5. 1
      crates/egui_demo_lib/Cargo.toml
  6. 5
      examples/custom_style/Cargo.toml
  7. 4
      examples/hello_world_par/Cargo.toml
  8. 4
      examples/images/Cargo.toml
  9. 2
      tests/test_egui_extras_compilation/Cargo.toml

12
.github/workflows/cargo_machete.yml

@ -0,0 +1,12 @@
name: Cargo Machete
on: [push, pull_request]
jobs:
cargo-machete:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Machete
uses: bnjbvr/cargo-machete@main

2
Cargo.lock

@ -1261,7 +1261,6 @@ dependencies = [
"document-features",
"egui",
"log",
"nix",
"puffin",
"raw-window-handle 0.6.2",
"serde",
@ -1306,7 +1305,6 @@ dependencies = [
"document-features",
"egui",
"egui_extras",
"log",
"serde",
"unicode_names2",
]

1
RELEASES.md

@ -33,7 +33,6 @@ We don't update the MSRV in a patch release, unless we really, really need to.
* [ ] `./scripts/docs.sh`: read and improve documentation of new stuff
* [ ] `cargo update`
* [ ] `cargo outdated` (or manually look for outdated crates in each `Cargo.toml`)
* [ ] `cargo machete`
## Release testing
* [ ] `cargo r -p egui_demo_app` and click around for while

1
crates/egui-winit/Cargo.toml

@ -62,7 +62,6 @@ egui = { workspace = true, default-features = false, features = ["log"] }
ahash.workspace = true
log.workspace = true
nix = { version = "0.26.4", default-features = false, optional = true }
raw-window-handle.workspace = true
web-time.workspace = true
winit = { workspace = true, default-features = false }

1
crates/egui_demo_lib/Cargo.toml

@ -45,7 +45,6 @@ syntect = ["egui_extras/syntect"]
egui = { workspace = true, default-features = false, features = ["color-hex"] }
egui_extras = { workspace = true, features = ["default"] }
log.workspace = true
unicode_names2 = { version = "0.6.0", default-features = false } # this old version has fewer dependencies
#! ### Optional dependencies

5
examples/custom_style/Cargo.toml

@ -9,6 +9,11 @@ publish = false
[lints]
workspace = true
[package.metadata.cargo-machete]
ignored = ["image"] # We need the .png feature
[dependencies]
eframe = { workspace = true, features = [
"default",

4
examples/hello_world_par/Cargo.toml

@ -11,6 +11,10 @@ publish = false
workspace = true
[package.metadata.cargo-machete]
ignored = ["winit"] # Just enable some features of it; see below
[dependencies]
eframe = { workspace = true, default-features = false, features = [
# accesskit struggles with threading

4
examples/images/Cargo.toml

@ -11,6 +11,10 @@ publish = false
workspace = true
[package.metadata.cargo-machete]
ignored = ["image"] # We only use the dependency to add more features to it
[dependencies]
eframe = { workspace = true, features = [
"default",

2
tests/test_egui_extras_compilation/Cargo.toml

@ -9,6 +9,8 @@ publish = false
[lints]
workspace = true
[package.metadata.cargo-machete]
ignored = ["eframe", "egui_extras"] # We don't use them, just check that things compile
[dependencies]
eframe = { workspace = true, features = ["default", "persistence"] }

Loading…
Cancel
Save