diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/config.rst | 14 | ||||
| -rw-r--r-- | doc/excluding.rst | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/doc/config.rst b/doc/config.rst index 8e3d885b..5b159d90 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -381,7 +381,7 @@ Settings common to many kinds of reporting. ...................... (multi-string) A list of regular expressions. Any line of your source code -containing a match for one of these regexes is excluded from being reported as +containing a match for one of these regexes is excluded from being reported as missing. More details are in :ref:`excluding`. If you use this option, you are replacing all the exclude regexes, so you'll need to also supply the "pragma: no cover" regex if you still want to use it. @@ -395,12 +395,22 @@ you'll exclude any line with three or more of any character. If you write ``pass``, you'll also exclude the line ``my_pass="foo"``, and so on. +.. _config_report_exclude_also: + +[report] exclude_also +..................... + +(multi-string) A list of regular expressions. This setting will preserve the +default exclude pattern instead of overwriting it. See +:ref:`config_report_exclude_lines` for details on exclusion regexes. + + .. _config_report_fail_under: [report] fail_under ................... -(float) A target coverage percentage. If the total coverage measurement is +(float) A target coverage percentage. If the total coverage measurement is under this value, then exit with a status code of 2. If you specify a non-integral value, you must also set ``[report] precision`` properly to make use of the decimal places. A setting of 100 will fail any value under 100, diff --git a/doc/excluding.rst b/doc/excluding.rst index 315d4e29..4651e6bb 100644 --- a/doc/excluding.rst +++ b/doc/excluding.rst @@ -101,7 +101,9 @@ For example, here's a list of exclusions I've used:: Note that when using the ``exclude_lines`` option in a configuration file, you are taking control of the entire list of regexes, so you need to re-specify the -default "pragma: no cover" match if you still want it to apply. +default "pragma: no cover" match if you still want it to apply. The +``exclude_also`` option can be used instead to preserve the default +exclusions while adding new ones. The regexes only have to match part of a line. Be careful not to over-match. A value of ``...`` will match any line with more than three characters in it. |
