Skip to content

Commit 4aa5a6a

Browse files
Fix lint
1 parent 4ff362c commit 4aa5a6a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

scripts/version_mark.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import sys
1919
from pathlib import Path
2020

21-
2221
VERSION_PATTERN = re.compile(
2322
r"^(version\s*=\s*\")(?P<maj>\d+)\.(?P<min>\d+)\.(?P<pat>\d+)(?P<pre>(a|b|rc|dev)(?P<num>\d+))?(\"\s*)$",
2423
re.MULTILINE,
@@ -62,10 +61,7 @@ def apply_prerelease(text: str, tag: str) -> tuple[str, str]:
6261
m_tag = re.match(r"(a|b|rc|dev)", pre)
6362
current_tag = m_tag.group(0) if m_tag else ""
6463
current_num = int(num_str) if num_str else 0
65-
if current_tag == tag:
66-
next_num = current_num + 1
67-
else:
68-
next_num = 1
64+
next_num = current_num + 1 if current_tag == tag else 1
6965
new_version = f"{maj}.{min_}.{pat}{tag}{next_num}"
7066
else:
7167
# No pre-release, add tag1

0 commit comments

Comments
 (0)