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

Function check_stubs

tools/precommit/docs.py:202–220  ·  view source on GitHub ↗
(ctx: Context, files: list[pathlib.Path])

Source from the content-addressed store, hash-verified

200
201
202def check_stubs(ctx: Context, files: list[pathlib.Path]) -> int:
203 files = build_python_module_paths(files)
204
205 exitcode = 0
206 for path in files:
207 strpath = str(path)
208 if strpath.endswith("__init__.py"):
209 continue
210 if not strpath.startswith(CHECK_PATHS):
211 continue
212 if strpath.startswith(EXCLUDE_PATHS):
213 continue
214 stub_path = PYTHON_MODULE_TO_DOC_PATH[path]
215 if not stub_path.exists():
216 exitcode += 1
217 ctx.error(
218 f"The module at {path} does not have a sphinx stub at {stub_path}"
219 )
220 return exitcode
221
222
223def check_virtual(ctx: Context, files: list[pathlib.Path]) -> int:

Callers 1

checkFunction · 0.85

Calls 3

existsMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected