summaryrefslogtreecommitdiffstats
path: root/doc/usage/extensions/coverage.rst
blob: b9c493b5f3b1d11afafccd48e1d6fab0fd3e1c8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
: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 ``-M coverage`` on the command line.

.. todo:: Write this section.

Several configuration values can be used to specify what the builder
should check:

.. confval:: coverage_ignore_modules

.. confval:: coverage_ignore_functions

.. confval:: coverage_ignore_classes

.. 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.

   .. _Python regular expressions: https://docs.python.org/library/re

   .. versionadded:: 2.1

.. confval:: coverage_c_path

.. confval:: coverage_c_regexes

.. confval:: coverage_ignore_c_items

.. confval:: coverage_write_headline

   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

.. confval:: coverage_show_missing_items

   Print objects that are missing to standard output also.
   ``False`` by default.

   .. versionadded:: 3.1

.. confval:: coverage_statistics_to_report

   Print a tabular 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 tabular 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