diff --git a/commitizen/bump.py b/commitizen/bump.py index 701b7d662e..2314b8d0e3 100644 --- a/commitizen/bump.py +++ b/commitizen/bump.py @@ -141,8 +141,7 @@ def update_version_in_files( """ # TODO: separate check step and write step for location in files: - filepath, *regexes = location.split(":") - regex = regexes[0] if regexes else None + filepath, _, regex = location.partition(":") with open(filepath, "r") as f: version_file = f.read() diff --git a/pyproject.toml b/pyproject.toml index 78f9cb170e..68e79b072b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ tag_format = "v$version" version_files = [ "pyproject.toml:version", "commitizen/__version__.py", - ".pre-commit-config.yaml:rev.\\s+(?=[^\\n]+Commitizen)" + ".pre-commit-config.yaml:rev:.\\s+(?=[^\\n]+Commitizen)" ] [tool.black]