Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork304
feat(version): add MANUAL_VERSION, --next and --patch to version comm…#1724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:v4-11-0
Are you sure you want to change the base?
feat(version): add MANUAL_VERSION, --next and --patch to version comm…#1724
Conversation
bearomorphism commentedDec 12, 2025
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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 divergetoo much from semver in your custom version scheme, then you won't get the full range of features.
woile commentedDec 12, 2025
There was a way to run all the pre-commits, but I don't remember how it works 😅 |
| @pytest.mark.parametrize( | ||
| "next_version, current_version, expected_version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
maybe renamenext_version tonext_increment?
In the user facing cli, it makes sense semantically:--next=MAJOR (give me the next major).
| assert expected_version in captured.out | ||
| def test_next_version_invalid_version(config, capsys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what about having a parametrize of the combinations that should fail:
@pytest.mark.parametrize( "args", [ # incomplete list: {"next"}, # ... {"--verbose", "next"} ])commitizen/commands/version.py Outdated
| out.error("Invalid version.") | ||
| return | ||
| if next_str := self.arguments.get("next"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what would happen here if I runcz version --project --next? I would expect that to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That also works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The behavior is the same ascz version --next=*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
But what would be the output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh I misunderstood your question. The output should depend on the commit history, right?
I forgot to implement that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I will do#1678 in another PR since it's a bit complicated (we need to considermajor_version_zero,bump_map, etc. for this feature and I prefer not to just copy & paste code, need some refactoring)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Indeed, that logic should be core and it should be possible to re-use it across commands.
woile commentedDec 12, 2025
Nice to see this going forward 🎉 |
54159ff to34fb773Comparecodecovbot commentedDec 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bearomorphism commentedDec 13, 2025
bearomorphism commentedDec 13, 2025
I will rebase this branch after#1726 is merged. The test failure should be resolved then. |
33d0f56 to8d938d2Compare…and, remove type alias
8d938d2 tof9afbd4Compare
Uh oh!
There was an error while loading.Please reload this page.
…and, remove type alias
Closes#1679
Manually tested and added test cases, the result LGTM.