Skip to content

Commit d666aa0

Browse files
carlossgLee-W
authored andcommitted
fix: print which tag is invalid
and the regex used for validation
1 parent e0b1c77 commit d666aa0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: commitizen/tags.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ 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+
raise InvalidVersion(
150+
f"Invalid version tag: '{tag.name}' does not match any configured tag format"
151+
)
150152
if "version" in m.groupdict():
151153
return self.scheme(m.group("version"))
152154

0 commit comments

Comments
 (0)