mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
fix regex
This commit is contained in:
parent
9632918850
commit
23d8932aaf
1 changed files with 1 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ def get_best_candidate_tag(rev: str, git_repo: str) -> str:
|
|||
all_tag_cmd = ('git', *NO_FS_MONITOR, 'tag', '-l')
|
||||
all_tags = cmd_output(*all_tag_cmd, cwd=git_repo)[1].strip().splitlines()
|
||||
all_tags = sorted(all_tags, key=LooseVersion)
|
||||
numbers_and_dots = re.compile("^v|\d+(\.\d+)*$")
|
||||
numbers_and_dots = re.compile("^v?\d+(\.\d+)*$")
|
||||
filtered_all_tags = [ver for ver in all_tags if numbers_and_dots.match(ver)]
|
||||
try: # or check for empty list
|
||||
rev = filtered_all_tags[-1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue