2008-03-12 16:37:22 -05:00
|
|
|
:mod:`sphinx.ext.coverage` -- Collect doc coverage stats
|
|
|
|
========================================================
|
|
|
|
|
|
|
|
.. module:: sphinx.ext.coverage
|
|
|
|
:synopsis: Check Python modules and C API for coverage in the documentation.
|
|
|
|
|
|
|
|
This extension features one additional builder, the :class:`CoverageBuilder`.
|
|
|
|
|
|
|
|
.. class:: CoverageBuilder
|
|
|
|
|
|
|
|
To use this builder, activate the coverage extension in your configuration
|
|
|
|
file and give ``-b coverage`` on the command line.
|
|
|
|
|
2008-11-09 12:46:32 -06:00
|
|
|
.. todo:: Write this section.
|
2008-03-12 16:37:22 -05:00
|
|
|
|
2019-02-26 10:09:43 -06:00
|
|
|
Several configuration values can be used to specify what the builder
|
2008-03-12 16:37:22 -05:00
|
|
|
should check:
|
|
|
|
|
|
|
|
.. confval:: coverage_ignore_modules
|
|
|
|
|
|
|
|
.. confval:: coverage_ignore_functions
|
|
|
|
|
|
|
|
.. confval:: coverage_ignore_classes
|
|
|
|
|
2019-05-14 07:48:52 -05:00
|
|
|
.. confval:: coverage_ignore_pyobjects
|
|
|
|
|
|
|
|
List of `Python regular expressions`_.
|
|
|
|
|
|
|
|
If any of these regular expressions matches any part of the full import path
|
|
|
|
of a Python object, that Python object is excluded from the documentation
|
|
|
|
coverage report.
|
|
|
|
|
2023-07-27 20:33:42 -05:00
|
|
|
.. _Python regular expressions: https://docs.python.org/library/re
|
|
|
|
|
2019-05-14 07:48:52 -05:00
|
|
|
.. versionadded:: 2.1
|
|
|
|
|
2008-03-12 16:37:22 -05:00
|
|
|
.. confval:: coverage_c_path
|
|
|
|
|
|
|
|
.. confval:: coverage_c_regexes
|
|
|
|
|
|
|
|
.. confval:: coverage_ignore_c_items
|
2011-01-04 15:22:23 -06:00
|
|
|
|
|
|
|
.. confval:: coverage_write_headline
|
2011-01-04 15:50:13 -06:00
|
|
|
|
|
|
|
Set to ``False`` to not write headlines.
|
|
|
|
|
|
|
|
.. versionadded:: 1.1
|
|
|
|
|
|
|
|
.. confval:: coverage_skip_undoc_in_source
|
|
|
|
|
|
|
|
Skip objects that are not documented in the source with a docstring.
|
|
|
|
``False`` by default.
|
|
|
|
|
|
|
|
.. versionadded:: 1.1
|
2019-05-14 07:48:52 -05:00
|
|
|
|
2020-10-03 06:47:01 -05:00
|
|
|
.. confval:: coverage_show_missing_items
|
2020-06-05 10:42:26 -05:00
|
|
|
|
|
|
|
Print objects that are missing to standard output also.
|
|
|
|
``False`` by default.
|
|
|
|
|
|
|
|
.. versionadded:: 3.1
|
|
|
|
|
2023-07-27 20:33:42 -05:00
|
|
|
.. confval:: coverage_statistics_to_report
|
|
|
|
|
|
|
|
Print a tabluar report of the coverage statistics to the coverage report.
|
|
|
|
``True`` by default.
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
|
|
|
.. code-block:: text
|
|
|
|
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
| Module | Coverage | Undocumented |
|
|
|
|
+=======================+==========+==============+
|
|
|
|
| package.foo_module | 100.00% | 0 |
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
| package.bar_module | 83.33% | 1 |
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
|
|
|
|
.. versionadded:: 7.2
|
|
|
|
|
|
|
|
.. confval:: coverage_statistics_to_stdout
|
|
|
|
|
|
|
|
Print a tabluar report of the coverage statistics to standard output.
|
|
|
|
``False`` by default.
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
|
|
|
.. code-block:: text
|
|
|
|
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
| Module | Coverage | Undocumented |
|
|
|
|
+=======================+==========+==============+
|
|
|
|
| package.foo_module | 100.00% | 0 |
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
| package.bar_module | 83.33% | 1 |
|
|
|
|
+-----------------------+----------+--------------+
|
|
|
|
|
|
|
|
.. versionadded:: 7.2
|