From d5f75ba56be3c5bbd8505722de8630be193d4431 Mon Sep 17 00:00:00 2001 From: BryanFRD Date: Wed, 7 Oct 2026 08:45:43 +0200 Subject: [PATCH] fix(cli): spell date and sequence strategies as configured in JSON output --- src/monorepo/run/plan.rs | 22 +++++++++++++++++++++- src/monorepo/run/why/mod.rs | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/monorepo/run/plan.rs b/src/monorepo/run/plan.rs index acf5c922..8338b8ba 100644 --- a/src/monorepo/run/plan.rs +++ b/src/monorepo/run/plan.rs @@ -502,7 +502,7 @@ fn strategy_label(forced: bool, pkg_strategy: VersioningStrategy, bump: BumpType if forced { "forced".to_string() } else if is_date_or_seq(pkg_strategy) { - format!("{pkg_strategy:?}").to_lowercase() + pkg_strategy.to_string() } else { bump.to_string() } @@ -545,6 +545,26 @@ mod tests { assert!(!is_date_or_seq(VersioningStrategy::Zerover)); } + #[test] + fn a_date_or_sequence_label_uses_the_config_spelling() { + assert_eq!( + strategy_label(false, VersioningStrategy::CalverShortSeq, BumpType::Minor), + "calver-short-seq" + ); + assert_eq!( + strategy_label(false, VersioningStrategy::CalverShort, BumpType::Patch), + "calver-short" + ); + assert_eq!( + strategy_label(false, VersioningStrategy::Semver, BumpType::Minor), + "minor" + ); + assert_eq!( + strategy_label(true, VersioningStrategy::CalverSeq, BumpType::Minor), + "forced" + ); + } + #[test] fn version_unchanged_carries_the_version_it_recomputed() { let reason = SkipReason::VersionUnchanged { diff --git a/src/monorepo/run/why/mod.rs b/src/monorepo/run/why/mod.rs index bbcf2f36..7a157844 100644 --- a/src/monorepo/run/why/mod.rs +++ b/src/monorepo/run/why/mod.rs @@ -240,7 +240,7 @@ fn explain( package: pkg.name.clone(), path: pkg.path.clone(), shared_paths: pkg.shared_paths.clone(), - strategy: format!("{strategy:?}").to_lowercase(), + strategy: strategy.to_string(), current_version, version_source, monorepo: is_monorepo,