@@ -72,6 +72,41 @@ Alternate tools to `interrogate`_ are `docstr-coverage`_ and
72
72
output resembling that of `pytest-cov `_, which is the the equivalent tool
73
73
for source code coverage.
74
74
75
+ Numpydoc Validation
76
+ -------------------
77
+ In order to validate the style of :ref: `Numpydoc Docstrings `, it is possible to
78
+ take advantage of `numpydoc `_ Sphinx extension. Note that this extension will
79
+ only check for those objcts whose docstring needs to be rendered. It is not a
80
+ command line tool which checks all docstrings style in your source code.
81
+
82
+ Because it is a Sphinx extension, it needs to be configured via through the
83
+ ``conf.py ``. see :ref: `The \`\` doc/\`\` directory`. Start by adding it to the
84
+ list of extensions:
85
+
86
+ .. code-block :: python
87
+
88
+ extensions = [
89
+ ' numpydoc' ,
90
+ ...
91
+ ]
92
+
93
+ Once added, you can select which `validation checks
94
+ <https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks> `_
95
+ need to be addressed by using the ``numpydoc_validation_checks `` dictionary:
96
+
97
+ .. code-block :: python
98
+
99
+ numpydoc_validation_checks = {" GL08" }
100
+
101
+ This will issue the following warning for any object without a docstring:
102
+
103
+ .. code-block :: python
104
+
105
+ " The object does not have a docstring"
106
+
107
+ For a complete list of available checks, please check the `full mapping of
108
+ validation checks
109
+ <https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks> `_.
75
110
76
111
Pydocstyle
77
112
----------
@@ -98,3 +133,4 @@ under the ``[tool.pydocstyle]`` entry:
98
133
.. _docformatter : https://github.com/PyCQA/docformatter
99
134
.. _codespell : https://github.com/codespell-project/codespell
100
135
.. _pytest-cov : https://pytest-cov.readthedocs.io/en/latest/
136
+ .. _numpydoc : https://numpydoc.readthedocs.io/en/latest/format.html
0 commit comments