feat(version): add MANUAL_VERSION, --next and --patch to version command#1724
feat(version): add MANUAL_VERSION, --next and --patch to version command#1724bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
Conversation
|
@Lee-W I already ran Do you have any ideas why this happen |
| version = f"{version_scheme.minor}" | ||
| out.write(version.major) | ||
| return | ||
| if self.arguments.get("minor"): |
There was a problem hiding this comment.
I realize now that this creates problems with the (not)monotonic kind of versions (and possible non-semver). I'm not sure what to do about it.
I think for now it's fine that if you diverge too much from semver in your custom version scheme, then you won't get the full range of features.
|
There was a way to run all the pre-commits, but I don't remember how it works 😅 |
| assert expected_version in captured.out | ||
|
|
||
|
|
||
| def test_next_version_invalid_version(config, capsys): |
There was a problem hiding this comment.
what about having a parametrize of the combinations that should fail:
@pytest.mark.parametrize(
"args",
[
# incomplete list:
{"next"},
# ...
{"--verbose", "next"}
]
)|
Nice to see this going forward 🎉 |
54159ff to
34fb773
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1724 +/- ##
==========================================
- Coverage 97.93% 97.92% -0.01%
==========================================
Files 60 61 +1
Lines 2611 2654 +43
==========================================
+ Hits 2557 2599 +42
- Misses 54 55 +1 ☔ View full report in Codecov by Sentry. |
|
I will rebase this branch after #1726 is merged. The test failure should be resolved then. |
8d938d2 to
f9afbd4
Compare
f9afbd4 to
094f48b
Compare
3b48a33 to
b07121e
Compare
noirbizarre
left a comment
There was a problem hiding this comment.
That's an interesting feature, one that I would totally use!
Also, I never realized that the version command was doing totally different things depending on the flags 😅
So maybe it's the occasion to have a dedicated --version flag and have the version command focusing on the the project versioning and not the Commitizen version. It would be cleaner, easier to understand and more standard. WDYT ?
Note
I would not remove the Type aliases as it makes the PR bigger than it should and it introduce a breaking change (and reading the PR and issues, we know that it has been used by some users for some custom version schemes).
I would prefer to merge this before #1518 because it is a bit larger than this PR.
+1. As a user, I often run |
b07121e to
044416d
Compare
575468d to
3af1a57
Compare
4b6a441 to
c3d27c9
Compare
c3d27c9 to
cd857d8
Compare
|
@woile @noirbizarre @Lee-W |
|
There are some open conversations still |
cd857d8 to
5502285
Compare
5502285 to
4a9a5da
Compare
Closes #1679
Manually tested and added test cases, the result LGTM.