-
-
Notifications
You must be signed in to change notification settings - Fork 266
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cz bump with custom type, scope and exclamation mark #774
Conversation
Codecov ReportAttention:
... and 1 file with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
Please merge this. |
Looks good! Could you rebase please? |
fd77357
to
9af08f6
Compare
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.
mostly looks good to me. left one minor question
@Lee-W what's the minor question? |
@@ -104,7 +104,7 @@ class Settings(TypedDict, total=False): | |||
MINOR = "MINOR" | |||
PATCH = "PATCH" | |||
|
|||
bump_pattern = r"^(((BREAKING[\-\ ]CHANGE|feat|fix|refactor|perf)(\(.+\))?(!)?)|\w+!):" | |||
bump_pattern = r"^((BREAKING[\-\ ]CHANGE|\w+)(\(.+\))?!?):" |
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.
Why do we remove feat|fix|refactor|perf)
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.
As I understood commitizen allows you to define custom commit types, if we'd limit this to only feat|fix|refactor|perf
then it wouldn't match for custom types.
Previously \w+!
was included, but this didn't include the scope, the new regex is basically a simplified version that allows \w+!
with a scope.
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.
We can change it here. But we'll need to move the original value to https://github.com/commitizen-tools/commitizen/blob/master/commitizen/cz/conventional_commits/conventional_commits.py#L31.
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.
Why? This change should be backwards compatible and it does fix a bug. chore!
updates the major version but chore(scope)!
does not.
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.
yep, I think you're right. looks good to me. thanks for helping out!
https://github.com/commitizen-tools/commitizen/pull/774/files#r1354592313 did not succeeded sending it earlier 🤦♂️ |
I think after we fix the CI and the last comment. We're good to go |
The old implementation wrongly set the `increment` variable to `None` if `increment = "PATCH"` and `new_increment = None`.
The regex didn't match the following commit with exclamation mark, and therefore didn't update the version. chore(deps)!: drop support for Python 3.9 The regex was simplified, because a lot groups were not needed.
9af08f6
to
e3b7bd1
Compare
@woile @noirbizarre this pr looks good to me. plan to merge it these days. please let me know if you want to take a look |
Description
This change adds support for version bumping for custom types with a scope. Previously, a commit with the following message didn't increment the version.
Also, there is a minor bugfix in the bump command, that resulted in a wrongly calculated increment. (It's separated into a commit)
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testNot sure if I have to update the documentation, because I'd say it's the expected behavior from the conventional commit specification.
Expected behavior
See steps to reproduce.
Steps to Test This Pull Request
Additional context
Related to #673