Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/monorepo/run/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/monorepo/run/why/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading