Skip to content

Commit ceeefb0

Browse files
fix(bump): guard sibling-mismatch detection behind check_consistency, preserve trailing whitespace
* skip _LIKELY_VERSION_VALUE_RE.search and inconsistent_lines tracking when check_consistency=False, so the legacy fast path stays unchanged as the PR claimed * use rstrip('\r\n') instead of rstrip() so the reported line content matches the actual file content (preserves meaningful trailing whitespace) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b088993 commit ceeefb0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

commitizen/bump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def update_version_in_files(
9898
# certainly an inconsistent source we'd otherwise miss
9999
# silently (#595).
100100
bumped_line = line
101-
if _LIKELY_VERSION_VALUE_RE.search(line):
102-
inconsistent_lines.append((lineno, line.rstrip()))
101+
if check_consistency and _LIKELY_VERSION_VALUE_RE.search(line):
102+
inconsistent_lines.append((lineno, line.rstrip("\r\n")))
103103
else:
104104
bumped_line = line
105105

0 commit comments

Comments
 (0)