Skip to content

Commit 6a7287c

Browse files
authored
Merge pull request #2445 from GitoxideLabs/improvements
Add `cargo machete` CI job including exclusions
2 parents f7277f3 + abd0724 commit 6a7287c

11 files changed

Lines changed: 94 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ jobs:
470470
rustup update stable
471471
rustup default stable
472472
rustup component add clippy rustfmt
473+
- name: Install cargo machete
474+
run: cargo install cargo-machete --version 0.9.1 --locked
473475
- uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
476+
- name: Run cargo machete
477+
run: cargo machete
474478
- name: Run cargo clippy
475479
run: just clippy -D warnings -A unknown-lints --no-deps
476480
- name: Run cargo doc

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ members = [
304304
[package.metadata.docs.rs]
305305
features = ["document-features", "max"]
306306

307+
[package.metadata.cargo-machete]
308+
ignored = [
309+
# Feature-only dependency selected through `prodash-render-line-crossterm` wiring.
310+
"crosstermion",
311+
# Pinned direct dependency to avoid precompiled binaries; intentionally not referenced in code.
312+
"serde_derive",
313+
]
314+
307315
[package.metadata.binstall]
308316
pkg-url = "{ repo }/releases/download/v{ version }/gitoxide-max-pure-v{ version }-{ target }{ archive-suffix }"
309317
bin-dir = "gitoxide-max-pure-v{ version }-{ target }/{ bin }{ binary-ext }"

gitoxide-core/Cargo.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,33 @@ document-features = { version = "0.2.0", optional = true }
9797

9898
[package.metadata.docs.rs]
9999
features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde"]
100+
101+
[package.metadata.cargo-machete]
102+
ignored = [
103+
# Enabled through `async-client` feature wiring only.
104+
"async-io",
105+
# Enabled through `async-client` feature wiring only.
106+
"async-net",
107+
# Enabled through `async-client` feature wiring only.
108+
"async-trait",
109+
# Enabled through `async-client` feature wiring only.
110+
"blocking",
111+
# Enabled through `estimate-hours` feature wiring only.
112+
"fs-err",
113+
# Enabled through `async-client` feature wiring only.
114+
"futures-io",
115+
# Enabled through `async-client` feature wiring only.
116+
"futures-lite",
117+
# Configuration-only dependency selected by the `archive` feature.
118+
"gix-archive-for-configuration-only",
119+
# Configuration-only dependency used to constrain global `gix-error` feature resolution.
120+
"gix-error-for-configuration-only",
121+
# Configuration-only dependency used to constrain global `gix-pack` feature resolution.
122+
"gix-pack-for-configuration-only",
123+
# Configuration-only dependency selected by `async-client` feature wiring.
124+
"gix-transport-configuration-only",
125+
# Imported as crate `layout`, which does not match the package name `layout-rs`.
126+
"layout-rs",
127+
# Enabled through `estimate-hours` feature wiring only.
128+
"smallvec",
129+
]

gix-commitgraph/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ gix-hash = { path = "../gix-hash", features = ["sha256"] }
3939
[package.metadata.docs.rs]
4040
all-features = true
4141
features = ["document-features"]
42+
43+
[package.metadata.cargo-machete]
44+
ignored = [
45+
# Needed for `bstr/serde` feature forwarding, even though no direct `bstr` paths are referenced.
46+
"bstr",
47+
]

gix-commitgraph/fuzz/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ edition = "2021"
77
[package.metadata]
88
cargo-fuzz = true
99

10+
[package.metadata.cargo-machete]
11+
ignored = [
12+
# Kept for fuzz-input modeling support in this fuzz package.
13+
"arbitrary",
14+
]
15+
1016
[dependencies]
1117
anyhow = "1.0.76"
1218
arbitrary = { version = "1.3.2", features = ["derive"] }

gix-config/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ path = "./benches/large_config_file.rs"
4747
[package.metadata.docs.rs]
4848
all-features = true
4949
features = ["document-features"]
50+
51+
[package.metadata.cargo-machete]
52+
ignored = [
53+
# Public optional `serde` feature is retained for downstream feature compatibility.
54+
"serde",
55+
]

gix-credentials/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ gix-testtools = { path = "../tests/tools" }
4444
[package.metadata.docs.rs]
4545
all-features = true
4646
features = ["document-features"]
47+
48+
[package.metadata.cargo-machete]
49+
ignored = [
50+
# Public optional `serde` feature is retained for downstream feature compatibility.
51+
"serde",
52+
]

gix-diff/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,11 @@ imara-diff-v2 = { version = "0.2.0", package = "imara-diff" }
7575
[package.metadata.docs.rs]
7676
all-features = true
7777
features = ["document-features"]
78+
79+
[package.metadata.cargo-machete]
80+
ignored = [
81+
# WASM support dependency activated through the `wasm = ["dep:getrandom"]` feature.
82+
"getrandom",
83+
# Optional API feature wiring (`dep:serde`) referenced only from feature definitions.
84+
"serde",
85+
]

gix-ignore/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ gix-fs = { path = "../gix-fs" }
3636
[package.metadata.docs.rs]
3737
all-features = true
3838
features = ["document-features"]
39+
40+
[package.metadata.cargo-machete]
41+
ignored = [
42+
# Public optional `serde` feature is retained for downstream feature compatibility.
43+
"serde",
44+
]

gix-merge/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ pretty_assertions = "1.4.0"
5252
[package.metadata.docs.rs]
5353
all-features = true
5454
features = ["document-features"]
55+
56+
[package.metadata.cargo-machete]
57+
ignored = [
58+
# Doc-only macro dependency used under `all(doc, feature = "document-features")`.
59+
"document-features",
60+
# Optional `serde` feature is retained for downstream API compatibility.
61+
"serde",
62+
]

0 commit comments

Comments
 (0)