Add release_branch checker

This commit is contained in:
Mikhail f. Shiryaev 2022-02-18 13:26:55 +01:00
parent 0f1565a3a2
commit d2a8cff508
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -5,6 +5,7 @@ import re
import subprocess
from typing import Optional
RELEASE_BRANCH_REGEXP = r"^\d+[.]\d+$"
TAG_REGEXP = r"^v\d{2}[.][1-9]\d*[.][1-9]\d*[.][1-9]\d*-(testing|prestable|stable|lts)$"
SHA_REGEXP = r"^([0-9]|[a-f]){40}$"
@ -31,6 +32,13 @@ def commit(name: str):
return name
def release_branch(name: str):
r = re.compile(RELEASE_BRANCH_REGEXP)
if not r.match(name):
raise argparse.ArgumentTypeError("release branch should be as 12.1")
return name
class Runner:
"""lightweight check_output wrapper with stripping last NEW_LINE"""