History

smart-release: improved safety bump log message (#197)

Sebastian Thiel committed 5 years ago

Commit 9b78c341 parent 2b554274 files · +15 −7Browse files

Unified · Split

4 files
  1. cargo-smart-release/src/command/release/manifest.rs +9 −1
  2. cargo-smart-release/tests/snapshots/triple-depth-workspace/a-b-dry-run-success-unconditional +2 −2
  3. cargo-smart-release/tests/snapshots/triple-depth-workspace/a-dry-run-success-multi-crate-unconditional +2 −2
  4. cargo-smart-release/tests/snapshots/triple-depth-workspace/a-dry-run-success-unconditional +2 −2
cargo-smart-release/src/command/release/manifest.rs+9−1
@@ -86,7 +86,15 @@ pub(in crate::command::release_impl) fn edit_version_and_fixup_dependent_crates< · 85 unmodified lines
8686 if safety_bumped_packages.is_empty() {
8787 Cow::from("")
8888 } else {
89− format!(", safety bump {}", names_and_versions(&safety_bumped_packages)).into()
89+ match safety_bumped_packages.len() {
90+ 1 => format!(", safety bump {}", names_and_versions(&safety_bumped_packages)).into(),
91+ num_crates => format!(
92+ ", safety bump {} crates\n\nSAFETY BUMP: {}",
93+ num_crates,
94+ names_and_versions(&safety_bumped_packages)
95+ )
96+ .into(),
97+ }
9098 }
9199 }
92100 );
cargo-smart-release/tests/snapshots/triple-depth-workspace/a-b-dry-run-success-unconditional+2−2
@@ -9,8 +9,8 @@ · 8 unmodified lines
99 [INFO ] Pending 'b' manifest dependencies update: 'a = "^0.9.0"' (from "0.8.0" )
1010 [INFO ] Pending 'c' manifest version update: "8.1.0"
1111 [INFO ] Pending 'c' manifest dependencies update: 'b = "^0.9.0"' (from "0.8.0" )
12−[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
13−[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
12+[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
13+[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
1414 [INFO ] WOULD create tag a-v0.9.0
1515 [INFO ] Congratulations for the new release of 'b' 🎉
1616 [INFO ] WOULD prepare release of b v0.9.0
cargo-smart-release/tests/snapshots/triple-depth-workspace/a-dry-run-success-multi-crate-unconditional+2−2
@@ -8,6 +8,6 @@ · 7 unmodified lines
88 [INFO ] Pending 'b' manifest dependencies update: 'a = "^0.9.0"' (from "0.8.0" )
99 [INFO ] Pending 'c' manifest version update: "8.1.0"
1010 [INFO ] Pending 'c' manifest dependencies update: 'b = "^0.9.0"' (from "0.8.0" )
11−[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
12−[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
11+[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
12+[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
1313 [INFO ] WOULD create tag a-v0.9.0
cargo-smart-release/tests/snapshots/triple-depth-workspace/a-dry-run-success-unconditional+2−2
@@ -8,6 +8,6 @@ · 7 unmodified lines
88 [INFO ] Pending 'b' manifest dependencies update: 'a = "^0.9.0"' (from "0.8.0" )
99 [INFO ] Pending 'c' manifest version update: "8.1.0"
1010 [INFO ] Pending 'c' manifest dependencies update: 'b = "^0.9.0"' (from "0.8.0" )
11−[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
12−[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump b v0.9.0, c v8.1.0"
11+[INFO ] WOULD persist changes to manifests with: "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
12+[INFO ] WOULD run "git" "commit" "-am" "Bump a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
1313 [INFO ] WOULD create tag a-v0.9.0

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t