1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Replace cargo machete with cargo shear (#8094)

We've had good experiences with `cargo shear` at Rerun
This commit is contained in:
Emil Ernerfeldt
2026-04-13 17:48:43 +02:00
committed by GitHub
parent 170b46a0c8
commit db87c712a1
13 changed files with 42 additions and 33 deletions

View File

@@ -1,19 +0,0 @@
name: Cargo Machete
on: [push, pull_request]
jobs:
cargo-machete:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92
- name: Machete install
## The official cargo-machete action
uses: bnjbvr/cargo-machete@v0.9.1
- name: Checkout
uses: actions/checkout@v4
- name: Machete Check
run: cargo machete

25
.github/workflows/cargo_shear.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
# Looks for unused crates.
name: Cargo Shear
on:
push:
branches:
- "main"
pull_request:
types: [opened, synchronize]
jobs:
cargo-shear:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cargo Shear
uses: taiki-e/install-action@v2.48.7
with:
tool: cargo-shear@1.11.2
- name: Run Cargo Shear
run: |
cargo shear

View File

@@ -1375,8 +1375,6 @@ dependencies = [
"log", "log",
"memoffset", "memoffset",
"profiling", "profiling",
"wasm-bindgen",
"web-sys",
"winit", "winit",
] ]

View File

@@ -20,6 +20,9 @@ workspace = true
all-features = true all-features = true
rustdoc-args = ["--generate-link-to-definition"] rustdoc-args = ["--generate-link-to-definition"]
[package.metadata.cargo-shear]
ignored = ["wayland-cursor"] # TODO(emilk): remove when we update winit
[features] [features]
default = ["clipboard", "links", "wayland", "winit/default", "x11"] default = ["clipboard", "links", "wayland", "winit/default", "x11"]

View File

@@ -8,8 +8,8 @@ rust-version.workspace = true
publish = false publish = false
default-run = "egui_demo_app" default-run = "egui_demo_app"
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["profiling"] ignored = ["image", "profiling", "wasm-bindgen-futures"]
[lints] [lints]
workspace = true workspace = true

View File

@@ -20,6 +20,9 @@ workspace = true
all-features = true all-features = true
rustdoc-args = ["--generate-link-to-definition"] rustdoc-args = ["--generate-link-to-definition"]
[package.metadata.cargo-shear]
ignored = ["image"] # We need the png feature
[lib] [lib]

View File

@@ -66,10 +66,6 @@ document-features = { workspace = true, optional = true }
# Native: # Native:
winit = { workspace = true, optional = true, default-features = false, features = ["rwh_06"] } winit = { workspace = true, optional = true, default-features = false, features = ["rwh_06"] }
# Web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
web-sys = { workspace = true, features = ["console"] }
wasm-bindgen.workspace = true
[dev-dependencies] [dev-dependencies]
glutin = { workspace = true, default-features = true } # examples/pure_glow glutin = { workspace = true, default-features = true } # examples/pure_glow

View File

@@ -10,8 +10,8 @@ publish = false
workspace = true workspace = true
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["image"] # We need the .png feature ignored = ["image"] # We need the png feature
[dependencies] [dependencies]

View File

@@ -11,7 +11,7 @@ publish = false
workspace = true workspace = true
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["winit"] # Just enable some features of it; see below ignored = ["winit"] # Just enable some features of it; see below

View File

@@ -11,7 +11,7 @@ publish = false
workspace = true workspace = true
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["image"] # We only use the dependency to add more features to it ignored = ["image"] # We only use the dependency to add more features to it

View File

@@ -7,7 +7,7 @@ edition = "2024"
rust-version = "1.92" rust-version = "1.92"
publish = false publish = false
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["profiling"] ignored = ["profiling"]
[lints] [lints]

View File

@@ -5,6 +5,9 @@ license.workspace = true
rust-version.workspace = true rust-version.workspace = true
version.workspace = true version.workspace = true
[package.metadata.cargo-shear]
ignored = ["image"] # We need the png feature
[dev-dependencies] [dev-dependencies]
egui = { workspace = true, default-features = true } egui = { workspace = true, default-features = true }
egui_kittest = { workspace = true, features = ["snapshot", "wgpu"] } egui_kittest = { workspace = true, features = ["snapshot", "wgpu"] }

View File

@@ -9,7 +9,7 @@ publish = false
[lints] [lints]
workspace = true workspace = true
[package.metadata.cargo-machete] [package.metadata.cargo-shear]
ignored = ["eframe", "egui_extras"] # We don't use them, just check that things compile ignored = ["eframe", "egui_extras"] # We don't use them, just check that things compile
[dependencies] [dependencies]