Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2a0472c

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎commitizen/tags.py‎

Lines changed: 3 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /