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,