(docstring)
| 1079 | |
| 1080 | |
| 1081 | def _check_valid_versions_on_docstrings(docstring): |
| 1082 | for match in CHECK_VALID_VERSION_RE.finditer(docstring): |
| 1083 | vtype = match.group("vtype") |
| 1084 | version = match.group("version") |
| 1085 | versions = [vs.strip() for vs in version.split(",")] |
| 1086 | bad_versions = [] |
| 1087 | for vs in versions: |
| 1088 | ret = subprocess.run( |
| 1089 | [sys.executable, str(SALT_CODE_DIR / "version.py"), vs], check=False |
| 1090 | ) |
| 1091 | if ret.returncode: |
| 1092 | bad_versions.append(vs) |
| 1093 | if bad_versions: |
| 1094 | return vtype, ", ".join(bad_versions) |
| 1095 | return False |
| 1096 | |
| 1097 | |
| 1098 | CLI_EXAMPLE_PRESENT_RE = re.compile(r"CLI Example(?:s)?:") |
no test coverage detected