Coverage Check¶
The coverage check implements Layer 6 (Visibility) of docvet's quality model. It detects missing __init__.py files in your source tree that would make Python packages invisible to mkdocs and other documentation generators. 1 rule.
Rules¶
| Rule ID | Category | Description |
|---|---|---|
missing-init |
required | Directory in source tree lacks __init__.py, making its Python files invisible to documentation generators |
The check walks from each discovered file's parent directory up to the source root, looking for missing __init__.py files at each level. Findings are deduplicated per directory and include the count of affected files.
When this matters
If you use mkdocs + mkdocstrings (or any tool that discovers packages via __init__.py), a missing init file means that entire directory is invisible to your docs site — even if the code is importable at runtime.
Example Output¶
Configuration¶
Info
This check has no check-specific configuration. There is no [tool.docvet.coverage] section.
src-root behavior¶
The coverage check uses the src-root setting from [tool.docvet] to determine where to start scanning:
- If
src-rootis not set and asrc/directory exists at the project root, it defaults to"src" - If
src-rootis not set and nosrc/directory exists, it defaults to"."(project root) - If
src-rootis explicitly set, the configured value is used as-is
Usage¶
Run the coverage check on your entire codebase:
Check only files with unstaged changes (default):
Check only staged files:
Check specific files:
Add --verbose for file count and timing, or -q to suppress the summary line:
Or run coverage as part of all checks: