(v: str)
| 958 | |
| 959 | |
| 960 | def _normalize_go_version(v: str) -> str: |
| 961 | v = v.strip() |
| 962 | if v.startswith("v"): |
| 963 | v = v[1:] |
| 964 | v = re.sub(r"-(alpha|beta|rc)(\d+)$", r"-\1.\2", v) |
| 965 | if re.search(r"(?i)-(alpha|beta)\.0$", v): |
| 966 | return f"v{v}" |
| 967 | if re.search(r"(?i)-(alpha|beta|rc)\.\d+$", v): |
| 968 | return f"v{v}" |
| 969 | if re.search(r"(?i)-pre$", v): |
| 970 | return f"v{v}" |
| 971 | dev_match = re.search(r"(?i)(?:-dev|\.dev)(\d+)$", v) |
| 972 | if dev_match: |
| 973 | base = re.sub(r"(?i)(?:-dev|\.dev)\d+$", "", v) |
| 974 | return f"v{base}-alpha.{dev_match.group(1)}" |
| 975 | if re.search(r"(?i)(-snapshot|\.dev|-dev)$", v): |
| 976 | base = re.sub(r"(?i)(-snapshot|\.dev|-dev)$", "", v) |
| 977 | return f"v{base}-alpha.0" |
| 978 | return f"v{v}" |
| 979 | |
| 980 | |
| 981 | def _normalize_cmake_version(v: str) -> str: |
no test coverage detected