Skip to content

Commit

Permalink
chore: add debugging to bump
Browse files Browse the repository at this point in the history
command
  • Loading branch information
carlossg committed Feb 7, 2025
1 parent d4dfd33 commit 76265fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commitizen/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from glob import iglob
from string import Template
from typing import cast
from logging import getLogger

from commitizen.defaults import MAJOR, MINOR, PATCH, bump_message, encoding
from commitizen.exceptions import CurrentVersionNotFoundError
Expand All @@ -14,6 +15,7 @@

VERSION_TYPES = [None, PATCH, MINOR, MAJOR]

logger = getLogger("commitizen")

def find_increment(
commits: list[GitCommit], regex: str, increments_map: dict | OrderedDict
Expand All @@ -38,7 +40,11 @@ def find_increment(
new_increment = increments_map[match_pattern]
break

if new_increment is None:
logger.debug(f"no increment needed for '{found_keyword}' in '{message}'")

if VERSION_TYPES.index(increment) < VERSION_TYPES.index(new_increment):
logger.debug(f"increment detected is '{new_increment}' due to '{found_keyword}' in '{message}'")
increment = new_increment

if increment == MAJOR:
Expand Down

0 comments on commit 76265fc

Please sign in to comment.