Skip to content

Commit aabd8a5

Browse files
committed
cargo-rail: fixing the schema issue; cleaning petgraph features manually
1 parent a70ac3f commit aabd8a5

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = ["docs/", "tests/", ".github/", ".config/", "examples/"]
2121
[dependencies]
2222
clap = { version = "4.5.53", features = ["derive", "cargo"] }
2323
cargo_metadata = "0.23.1"
24-
petgraph = "0.8.3"
24+
petgraph = { version = "0.8.3", default-features = false }
2525
toml_edit = { version = "0.23.9", features = ["serde"] }
2626
serde = { version = "1.0.228", features = ["derive"] }
2727
serde_json = "1.0.145"

src/config/schema.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct FieldSpec {
2424
/// the insertion order within each section.
2525
pub const SYNCABLE_FIELDS: &[FieldSpec] = &[
2626
// =========================================================================
27-
// [unify] section - 16 fields
27+
// [unify] section - 18 fields
2828
// =========================================================================
2929
FieldSpec {
3030
section: "unify",
@@ -116,6 +116,18 @@ pub const SYNCABLE_FIELDS: &[FieldSpec] = &[
116116
default_toml: "true",
117117
comment: "Auto-remove unused deps (default: true)",
118118
},
119+
FieldSpec {
120+
section: "unify",
121+
key: "detect_undeclared_features",
122+
default_toml: "true",
123+
comment: "Detect features borrowed via Cargo unification (default: true)",
124+
},
125+
FieldSpec {
126+
section: "unify",
127+
key: "fix_undeclared_features",
128+
default_toml: "true",
129+
comment: "Auto-fix borrowed features (default: true)",
130+
},
119131
FieldSpec {
120132
section: "unify",
121133
key: "max_backups",
@@ -252,7 +264,7 @@ mod tests {
252264
#[test]
253265
fn test_fields_for_section() {
254266
let unify_fields: Vec<_> = fields_for_section("unify").collect();
255-
assert_eq!(unify_fields.len(), 16);
267+
assert_eq!(unify_fields.len(), 18); // 16 + detect_undeclared_features + fix_undeclared_features
256268
assert!(unify_fields.iter().all(|f| f.section == "unify"));
257269

258270
let release_fields: Vec<_> = fields_for_section("release").collect();
@@ -268,15 +280,15 @@ mod tests {
268280
// Update this count when adding new fields
269281
assert_eq!(
270282
SYNCABLE_FIELDS.len(),
271-
27, // 16 unify + 10 release + 1 change-detection
283+
29, // 18 unify + 10 release + 1 change-detection
272284
"Total syncable fields count changed - update this test if intentional"
273285
);
274286
}
275287

276288
/// This test documents which config sections are syncable vs user-configured.
277289
///
278290
/// SYNCABLE (auto-added by `config sync`):
279-
/// - [unify] - 16 fields: workspace-wide dependency unification settings
291+
/// - [unify] - 18 fields: workspace-wide dependency unification settings
280292
/// - [release] - 10 fields: workspace-wide release settings
281293
/// - [change-detection] - 1 field: infrastructure patterns (custom is user-defined)
282294
///
@@ -310,6 +322,8 @@ mod tests {
310322
assert!(field_keys.contains(&("unify", "prune_dead_features")));
311323
assert!(field_keys.contains(&("unify", "preserve_features")));
312324
assert!(field_keys.contains(&("unify", "detect_unused")));
325+
assert!(field_keys.contains(&("unify", "detect_undeclared_features")));
326+
assert!(field_keys.contains(&("unify", "fix_undeclared_features")));
313327

314328
// [release] critical fields
315329
assert!(field_keys.contains(&("release", "tag_format")));

0 commit comments

Comments
 (0)