diff options
author | sur.la.route <christopher.pickering@keemail.me> | 2021-11-06 01:06:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 17:06:49 -0700 |
commit | bf3e96aa0aaba5f8e2095551498f50f1080f7f74 (patch) | |
tree | 4fa9948bb9231a97b4e56e616974e3e2b2934bdc | |
parent | e3e637c97365ceae4ee959bc4a0571c85f38355d (diff) | |
download | python-coveragepy-git-bf3e96aa0aaba5f8e2095551498f50f1080f7f74.tar.gz |
docs: updated docs for #578 recommendation (#1148)
* updated docs for #578 recommendation
#578
https://github.com/nedbat/coveragepy/issues/578#issuecomment-413881957
https://bitbucket.org/suriya/coverage-xml-bug/pull-requests/1/demonstrate-a-fix-to-coverage-xml-bug/diff
also see #1146
* fixed per lint
* updated per lint
-rw-r--r-- | doc/cmd.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst index b674e298..5957bc11 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -488,6 +488,44 @@ compatible with `Cobertura`_. You can specify the name of the output file with the ``-o`` switch. +To include complete file paths in the output file, rather than just +the file name, use [include] vs [source] in your ".coveragerc" file. + +For example, use this: + +.. code:: ini + + [run] + include = + foo/* + bar/* + + +which will result in + +.. code:: xml + + <class branch-rate="0" complexity="0" filename="bar/hello.py" line-rate="1" name="hello.py"> + <class branch-rate="0" complexity="0" filename="bar/baz/hello.py" line-rate="1" name="hello.py"> + <class branch-rate="0" complexity="0" filename="foo/hello.py" line-rate="1" name="hello.py"> + +in place of this: + +.. code:: ini + + [run] + source = + foo + bar + +which may result in + +.. code:: xml + + <class branch-rate="0" complexity="0" filename="hello.py" line-rate="1" name="hello.py"> + <class branch-rate="0" complexity="0" filename="baz/hello.py" line-rate="1" name="hello.py"> + + Other common reporting options are described above in :ref:`cmd_reporting`. |