docvet 1.13: One Config Line Unlocks Sphinx/RST Support — NumPy Works Out of the Box #348
Alberto-Codes
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
If your team writes Sphinx-style docstrings —
:param name:,:returns:,:raises ValueError:— docvet couldn't check them before. As of v1.13.0, one line in your pyproject.toml changes that. And if you use NumPy-style sections, they already work with zero configuration.Sphinx/RST support
Add one line to your project config:
docvet maps Sphinx field-list directives (
:param:,:type:,:returns:,:rtype:,:raises:,:ivar:,:cvar:) to the same internal section model used for Google-style, so all existing enrichment rules apply: missing parameters, undocumented exceptions, absent examples — all of it.Five rules that have no RST equivalent (
require_yields,require_receives,require_warns,require_other_parameters,prefer_fenced_code_blocks) are auto-disabled in Sphinx mode. Override any of them by setting them explicitly in[tool.docvet.enrichment].NumPy section recognition
NumPy-style underlined headers work automatically in the default Google mode — no configuration change needed:
docvet recognizes these headers and maps them to the internal section model. Same rules, different syntax.
New rules
missing-returns— catches functions that return a value but don't document it. Smart enough to skip stubs,__init__methods, properties, and simple re-raises. Works in both Google and Sphinx modes.overload-has-docstring— flags@typing.overloadsignatures missing docstrings, while the existingmissing-docstringrule skips overloads to avoid double-reporting.By the numbers
Try it
Full changelog · Docs
All reactions