Skip to content

Commit ffd60a0

Browse files
committed
fix: print which tag is invalid
and the regex used for validation
1 parent 13bc11a commit ffd60a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: commitizen/tags.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def extract_version(self, tag: GitTag) -> Version:
146146
m for regex in self.version_regexes if (m := regex.fullmatch(tag.name))
147147
)
148148
if not (m := next(candidates, None)):
149-
raise InvalidVersion()
149+
regexes = ", ".join([str(r) for r in self.version_regexes])
150+
raise InvalidVersion(f"Invalid version tag: '{tag.name}' does not match any configured tag format: {regexes}")
150151
if "version" in m.groupdict():
151152
return self.scheme(m.group("version"))
152153

0 commit comments

Comments
 (0)