Skip to content

Commit cd7e3dd

Browse files
authored
Merge pull request commitizen-tools#567 from Kurt-von-Laven/version-files
fix(bump): Support regexes containing colons
2 parents 2110a14 + f093717 commit cd7e3dd

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

commitizen/bump.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def update_version_in_files(
141141
"""
142142
# TODO: separate check step and write step
143143
for location in files:
144-
filepath, *regexes = location.split(":")
145-
regex = regexes[0] if regexes else None
144+
filepath, _, regex = location.partition(":")
146145

147146
with open(filepath, "r") as f:
148147
version_file = f.read()

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tag_format = "v$version"
44
version_files = [
55
"pyproject.toml:version",
66
"commitizen/__version__.py",
7-
".pre-commit-config.yaml:rev.\\s+(?=[^\\n]+Commitizen)"
7+
".pre-commit-config.yaml:rev:.\\s+(?=[^\\n]+Commitizen)"
88
]
99

1010
[tool.black]

0 commit comments

Comments
 (0)