diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ff5ea..fcb0f31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ## Unreleased +* Ensures the JSON output of the check command is sorted to avoid changes in git between runs + ## v2.2.0 (August 15, 2024) * Adds the ability to build the default language to the root path, rather than placing it under a language code. diff --git a/rosey/src/runners/checker.rs b/rosey/src/runners/checker.rs index c66abb5..2c1b665 100644 --- a/rosey/src/runners/checker.rs +++ b/rosey/src/runners/checker.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; use std::{ - collections::{BTreeMap, HashMap}, + collections::BTreeMap, fs::{create_dir_all, read_to_string, File}, io::{BufWriter, Write}, str::FromStr, @@ -10,7 +10,7 @@ use globwalk::DirEntry; use crate::{RoseyLocale, RoseyOptions, RoseyTranslation}; -#[derive(Serialize, Deserialize, Hash, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Hash, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "camelCase")] enum RoseyCheckStates { Current, @@ -25,8 +25,8 @@ struct RoseyCheck { current: bool, base_total: i32, total: i32, - states: HashMap, - keys: HashMap, + states: BTreeMap, + keys: BTreeMap, } pub struct RoseyChecker {