You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using commitizen, if we have any non-eligible bump commits, like if we defined custom bump map. In which if I defined style or docs as non-eligible bumping commits. So when I did any non-bumping commits after that If I do PATCH version bumping commits. It's not bumping the version. It just bumps when any MAJOR or MINOR version is present.
Then do any non-eligible bumping commits like (docs, style, test) commit.
After that do any PATCH version commit like (fix, perf)
Current behavior
So while doing PATCH commits after any non-eligible commits. It's not bumping the PATCH version. We need to do any MAJOR or MINOR commit to bump the version.
Desired behavior
It should Bump the version if we have any PATCH commit in stack with any non-eligible commits.
Screenshots
No response
Environment
ubuntu wsl
The text was updated successfully, but these errors were encountered:
So we can solve this issue by adding one condition in find_increment function in commitizen.bump file.
def patched_find_increment(commits, regex: str, increments_map) -> str:
if isinstance(increments_map, dict):
increments_map = OrderedDict(increments_map)
# Most important cases are major and minor.
# Everything else will be considered patch.
select_pattern = re.compile(regex)
increment = None
for commit in commits:
for message in commit.message.split("\n"):
result = select_pattern.search(message)
if result:
found_keyword = result.group(1)
new_increment = None
for match_pattern in increments_map.keys():
if re.match(match_pattern, found_keyword):
new_increment = increments_map[match_pattern]
break
if increment == MAJOR:
break
elif increment == MINOR and new_increment == MAJOR:
increment = new_increment
elif increment == PATCH and new_increment is None:
increment = increment
elif increment == PATCH or increment is None:
increment = new_increment
return increment
Hi @Lavish-jain-5, thanks for reporting this issue. I just tested it with the latest version (3.26.0) without encountering this issue. Could you please update the commitizen and see whether the issue still persists? I'm going to close this one, but let me know if the issue is still there 🙂
Description
While using commitizen, if we have any non-eligible bump commits, like if we defined custom bump map. In which if I defined style or docs as non-eligible bumping commits. So when I did any non-bumping commits after that If I do PATCH version bumping commits. It's not bumping the version. It just bumps when any MAJOR or MINOR version is present.
Steps to reproduce
Define
bump_pattern = r"^(break|fix|feat|docs|style|refactor|perf|test)((.+))?(:.*)"
bump_map = {"break": "MAJOR", "feat": "MINOR", "fix": "PATCH", "refactor": "PATCH", "perf": "PATCH"}
Then do any non-eligible bumping commits like (docs, style, test) commit.
After that do any PATCH version commit like (fix, perf)
Current behavior
So while doing PATCH commits after any non-eligible commits. It's not bumping the PATCH version. We need to do any MAJOR or MINOR commit to bump the version.
Desired behavior
It should Bump the version if we have any PATCH commit in stack with any non-eligible commits.
Screenshots
No response
Environment
ubuntu wsl
The text was updated successfully, but these errors were encountered: