MCPcopy Index your code
hub / github.com/saltstack/salt / _check_valid_versions_on_docstrings

Function _check_valid_versions_on_docstrings

tools/precommit/docstrings.py:1081–1095  ·  view source on GitHub ↗
(docstring)

Source from the content-addressed store, hash-verified

1079
1080
1081def _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
1098CLI_EXAMPLE_PRESENT_RE = re.compile(r"CLI Example(?:s)?:")

Callers 1

check_docstringsFunction · 0.85

Calls 3

groupMethod · 0.80
runMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected