Skip to content

Commit bf5fa6c

Browse files
committed
docs: add validation check on key ordering
1 parent ae963ff commit bf5fa6c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

__meta/validators/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ and running `taplo fmt --check` and `taplo check`.
2727

2828
We also include several other checks to ensure integrity:
2929

30+
- The key orderings in a TOML file must match the the ordering of `properties` in the corresponding schema file.
31+
3032
- The `github-username` field for contributors must match the filename.
3133

3234
- The `slug` field for teams must match the filename.

__meta/validators/governance/src/loader.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ pub fn load_from_dir<T: DeserializeOwned + Debug + HasKeyOrder>(
2626
// Calculate the key order for the item.
2727
let mut item: T = toml::from_str(&content)
2828
.with_context(|| format!("Failed to parse {} file: {}", item_name, path.display()))?;
29-
30-
// Parse into IndexMap to get key order.
31-
let index_map: IndexMap<String, Value> = from_str(&content)?;
29+
let index_map: IndexMap<String, Value> = from_str(&content)?; // Parse into IndexMap to get key order.
3230
let key_order: Vec<String> = index_map.keys().cloned().collect();
3331
item.set_key_order(key_order);
3432

0 commit comments

Comments
 (0)