Configuration¶
docstr-health ships with sensible defaults that live in config.toml inside the package. Any of them can be overridden from your project's pyproject.toml under the [tool.docstr-health] section.
Overriding in pyproject.toml¶
[tool.docstr-health]
excluded = [".venv", "__init__", "__pycache__", "migrations"]
excluded_functions = ["wrapper", "main"]
threshold_bad = 80
threshold_warning = 60
threshold_special = 50
threshold_epic = 50
ci = false
failure_level = "warning"
Values defined in pyproject.toml take precedence over the packaged defaults.
Available options¶
Scanning¶
| Option | Type | Default | Description |
|---|---|---|---|
excluded | string[] | .venv, venv, __init__, __pycache__ | Name fragments excluded from scanning. |
excluded_functions | string[] | wrapper | Function names ignored during inspection. |
use_uv | bool | true | Prefer uv over pip when downloading PyPI. |
debug | bool | false | Enable debug logging to the log file. |
Statuses & thresholds¶
| Option | Type | Default | Description |
|---|---|---|---|
threshold_bad | int | 80 | Share of bad above which a module is bad. |
threshold_warning | int | 60 | Share of bad above which a module is warning. |
threshold_special | int | 50 | Share of special for a special module. |
threshold_epic | int | 50 | Share of epic for an epic module. |
CI¶
| Option | Type | Default | Description |
|---|---|---|---|
ci | bool | false | Enable quiet CI mode. |
failure_level | str | "warning" | Status at or below which CI fails. |
Appearance¶
Symbols and colors for every status are configurable:
[tool.docstr-health]
bad_symbol = "✗"
bad_color = "red"
good_symbol = "✔"
good_color = "green"
special_symbol = "★"
special_color = "yellow"
epic_symbol = "♥"
epic_color = "purple"
Tip
The full list of keys, including common_*, warning_*, and skipped_* variants, is available in the packaged config.toml.
Keyword levels¶
A docstring's status also depends on which keywords it contains. These keyword sets are defined per requirement level (requires_v1 … requires_v4) and the most complete level (requires_v4) is used by default:
- special keywords:
Args:,Parameters:,Attributes:,:param,:type, and their variants. - epic keywords:
Raises:,Usage:,Examples:,:raises, and their variants.
Where files are stored¶
The cache and logs live under your home directory:
~/.cache/docstr-health/
├── repos/ # cached Git clones and downloaded packages
└── logs/ # rotating log files (app.log)
Use --cache-dir to point the cache somewhere else.