From 80bbdb240e5ec552b5ea6b3718550e19e26a8e7f Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Fri, 7 Feb 2025 13:28:01 +0100 Subject: [PATCH] fix(bump): add debugging to bump command --- commitizen/bump.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commitizen/bump.py b/commitizen/bump.py index 2351dbd7ec..908899eb0e 100644 --- a/commitizen/bump.py +++ b/commitizen/bump.py @@ -4,6 +4,7 @@ import re from collections import OrderedDict from glob import iglob +from logging import getLogger from string import Template from typing import cast @@ -14,6 +15,8 @@ VERSION_TYPES = [None, PATCH, MINOR, MAJOR] +logger = getLogger("commitizen") + def find_increment( commits: list[GitCommit], regex: str, increments_map: dict | OrderedDict @@ -38,7 +41,15 @@ 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: