summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-10-10 08:53:01 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-10-15 13:58:50 -0400
commit7df8609f0462722fea3c0650cd94b76f668e07fe (patch)
treef553100b69b1b3ae10a947344d7abbc03b035fab
parentcb67b1feb2d68972f0eeb81a0e20b836b64c21dd (diff)
downloadpython-coveragepy-git-7df8609f0462722fea3c0650cd94b76f668e07fe.tar.gz
docs: updates for implicit relative path mapping
-rw-r--r--CHANGES.rst9
-rw-r--r--coverage/cmdline.py4
-rw-r--r--doc/cmd.rst16
-rw-r--r--doc/config.rst6
4 files changed, 22 insertions, 13 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 23399dc3..145024b7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,7 +20,14 @@ development at the same time, such as 4.5.x and 5.0.
Unreleased
----------
-Nothing yet.
+- Improvements to combining data files when using the
+ :ref:`config_run_relative_files` setting:
+
+ - During ``coverage combine``, relative file paths are implicitly combined
+ without needing a ``[paths]`` configuration setting.
+
+ - A ``[paths]`` setting like ``*/foo`` will now match ``foo/bar.py`` so that
+ relative file paths can be combined more easily.
.. _changes_6-5-0:
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index dbf66e0a..65ee73f8 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -379,8 +379,8 @@ COMMANDS = {
] + GLOBAL_ARGS,
usage="[options] <path1> <path2> ... <pathN>",
description=(
- "Combine data from multiple coverage files collected " +
- "with 'run -p'. The combined results are written to a single " +
+ "Combine data from multiple coverage files. " +
+ "The combined results are written to a single " +
"file representing the union of the data. The positional " +
"arguments are data files or directories containing data files. " +
"If no paths are provided, data files in the default data file's " +
diff --git a/doc/cmd.rst b/doc/cmd.rst
index c05b7bce..cb9a147e 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -377,6 +377,9 @@ It might be more convenient to use the ``[run] relative_files``
setting to store relative file paths (see :ref:`relative_files
<config_run_relative_files>`).
+If data isn't combining properly, you can see details about the inner workings
+with ``--debug=pathmap``.
+
If any of the data files can't be read, coverage.py will print a warning
indicating the file and the problem.
@@ -389,11 +392,10 @@ want to keep those files, use the ``--keep`` command-line option.
$ coverage combine --help
Usage: coverage combine [options] <path1> <path2> ... <pathN>
- Combine data from multiple coverage files collected with 'run -p'. The
- combined results are written to a single file representing the union of the
- data. The positional arguments are data files or directories containing data
- files. If no paths are provided, data files in the default data file's
- directory are combined.
+ Combine data from multiple coverage files. The combined results are written to
+ a single file representing the union of the data. The positional arguments are
+ data files or directories containing data files. If no paths are provided,
+ data files in the default data file's directory are combined.
Options:
-a, --append Append coverage data to .coverage, otherwise it starts
@@ -409,7 +411,7 @@ want to keep those files, use the ``--keep`` command-line option.
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
tried. [env: COVERAGE_RCFILE]
-.. [[[end]]] (checksum: 0ac91b0781d7146b87953f09090dab92)
+.. [[[end]]] (checksum: 0bdd83f647ee76363c955bedd9ddf749)
.. _cmd_erase:
@@ -1001,7 +1003,7 @@ of operation to log:
* ``multiproc``: log the start and stop of multiprocessing processes.
* ``pathmap``: log the remapping of paths that happens during ``coverage
- combine`` due to the ``[paths]`` setting. See :ref:`config_paths`.
+ combine``. See :ref:`config_paths`.
* ``pid``: annotate all warnings and debug output with the process and thread
ids.
diff --git a/doc/config.rst b/doc/config.rst
index 66b02eac..0cb2cfa6 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -259,9 +259,9 @@ information.
[run] relative_files
....................
-(*experimental*, boolean, default False) store relative file paths in the data
-file. This makes it easier to measure code in one (or multiple) environments,
-and then report in another. See :ref:`cmd_combine` for details.
+(boolean, default False) store relative file paths in the data file. This
+makes it easier to measure code in one (or multiple) environments, and then
+report in another. See :ref:`cmd_combine` for details.
Note that setting ``source`` has to be done in the configuration file rather
than the command line for this option to work, since the reporting commands