(ctx: Context, files: list[pathlib.Path])
| 200 | |
| 201 | |
| 202 | def 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 | |
| 223 | def check_virtual(ctx: Context, files: list[pathlib.Path]) -> int: |
no test coverage detected