Skip to content

Commit 348aa47

Browse files
committed
Help in docs didn't work with tmp
1 parent 5a30c8d commit 348aa47

File tree

11 files changed

+274
-15
lines changed

11 files changed

+274
-15
lines changed

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,17 @@ $(DOCBIN):
138138
tox -q -e doc --notest
139139

140140
cmd_help: $(DOCBIN)
141-
mkdir -p tmp
142141
for cmd in annotate combine debug erase html json report run xml; do \
143-
echo > tmp/$$cmd.rst; \
144-
echo ".. code::" >> tmp/$$cmd.rst; \
145-
echo >> tmp/$$cmd.rst; \
146-
echo " $$ coverage $$cmd --help" >> tmp/$$cmd.rst; \
142+
echo > doc/help/$$cmd.rst; \
143+
echo ".. code::" >> doc/help/$$cmd.rst; \
144+
echo >> doc/help/$$cmd.rst; \
145+
echo " $$ coverage $$cmd --help" >> doc/help/$$cmd.rst; \
147146
$(DOCBIN)/python -m coverage $$cmd --help | \
148147
sed \
149148
-e 's/__main__.py/coverage/' \
150149
-e '/^Full doc/d' \
151150
-e 's/^/ /' \
152-
>> tmp/$$cmd.rst; \
151+
>> doc/help/$$cmd.rst; \
153152
done
154153

155154
dochtml: $(DOCBIN) cmd_help ## Build the docs HTML output.

doc/cmd.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Python ``-m`` switch::
9090

9191
There are many options:
9292

93-
.. include:: ../tmp/run.rst
93+
.. include:: help/run.rst
9494

9595
If you want :ref:`branch coverage <branch>` measurement, use the ``--branch``
9696
flag. Otherwise only statement coverage is measured.
@@ -287,7 +287,7 @@ setting to store relative file paths (see :ref:`relative_files
287287
If any of the data files can't be read, coverage.py will print a warning
288288
indicating the file and the problem.
289289

290-
.. include:: ../tmp/combine.rst
290+
.. include:: help/combine.rst
291291

292292

293293
.. _cmd_erase:
@@ -297,7 +297,7 @@ Erase data: ``coverage erase``
297297

298298
To erase the collected data, use the **erase** command:
299299

300-
.. include:: ../tmp/erase.rst
300+
.. include:: help/erase.rst
301301

302302
If your configuration file indicates parallel data collection, **erase** will
303303
remove all of the data files.
@@ -351,7 +351,7 @@ For each module executed, the report shows the count of executable statements,
351351
the number of those statements missed, and the resulting coverage, expressed
352352
as a percentage.
353353

354-
.. include:: ../tmp/report.rst
354+
.. include:: help/report.rst
355355

356356
The ``-m`` flag also shows the line numbers of missing statements::
357357

@@ -426,7 +426,7 @@ the highlighting.
426426
A number of keyboard shortcuts are available for navigating the report.
427427
Click the keyboard icon in the upper right to see the complete list.
428428

429-
.. include:: ../tmp/html.rst
429+
.. include:: help/html.rst
430430

431431
The title of the report can be set with the ``title`` setting in the
432432
``[html]`` section of the configuration file, or the ``--title`` switch on
@@ -470,7 +470,7 @@ compatible with `Cobertura`_.
470470

471471
.. _Cobertura: http://cobertura.github.io/cobertura/
472472

473-
.. include:: ../tmp/xml.rst
473+
.. include:: help/xml.rst
474474

475475
You can specify the name of the output file with the ``-o`` switch.
476476

@@ -484,7 +484,7 @@ JSON reporting: ``coverage json``
484484

485485
The **json** command writes coverage data to a "coverage.json" file.
486486

487-
.. include:: ../tmp/json.rst
487+
.. include:: help/json.rst
488488

489489
You can specify the name of the output file with the ``-o`` switch. The JSON
490490
can be nicely formatted by specifying the ``--pretty-print`` switch.
@@ -521,7 +521,7 @@ For example::
521521
> else:
522522
> a = 2
523523

524-
.. include:: ../tmp/annotate.rst
524+
.. include:: help/annotate.rst
525525

526526
Other common reporting options are described above in :ref:`cmd_reporting`.
527527

@@ -544,7 +544,7 @@ Three types of information are available:
544544
* ``data``: show a summary of the collected coverage data
545545
* ``premain``: show the call stack invoking coverage
546546

547-
.. include:: ../tmp/debug.rst
547+
.. include:: help/debug.rst
548548

549549
.. _cmd_run_debug:
550550

doc/help/annotate.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
.. code::
3+
4+
$ coverage annotate --help
5+
Usage: coverage annotate [options] [modules]
6+
7+
Make annotated copies of the given files, marking statements that are executed
8+
with > and statements that are missed with !.
9+
10+
Options:
11+
-d DIR, --directory=DIR
12+
Write the output files to DIR.
13+
-i, --ignore-errors Ignore errors while reading source files.
14+
--include=PAT1,PAT2,...
15+
Include only files whose paths match one of these
16+
patterns. Accepts shell-style wildcards, which must be
17+
quoted.
18+
--omit=PAT1,PAT2,... Omit files whose paths match one of these patterns.
19+
Accepts shell-style wildcards, which must be quoted.
20+
--debug=OPTS Debug options, separated by commas. [env:
21+
COVERAGE_DEBUG]
22+
-h, --help Get help on this command.
23+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
24+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
25+
tried. [env: COVERAGE_RCFILE]
26+

doc/help/combine.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
.. code::
3+
4+
$ coverage combine --help
5+
Usage: coverage combine [options] <path1> <path2> ... <pathN>
6+
7+
Combine data from multiple coverage files collected with 'run -p'. The
8+
combined results are written to a single file representing the union of the
9+
data. The positional arguments are data files or directories containing data
10+
files. If no paths are provided, data files in the default data file's
11+
directory are combined.
12+
13+
Options:
14+
-a, --append Append coverage data to .coverage, otherwise it starts
15+
clean each time.
16+
--debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG]
17+
-h, --help Get help on this command.
18+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
19+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried.
20+
[env: COVERAGE_RCFILE]
21+

doc/help/debug.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
.. code::
3+
4+
$ coverage debug --help
5+
Usage: coverage debug <topic>
6+
7+
Display information about the internals of coverage.py, for diagnosing
8+
problems. Topics are: 'data' to show a summary of the collected data; 'sys' to
9+
show installation information; 'config' to show the configuration; 'premain'
10+
to show what is calling coverage.
11+
12+
Options:
13+
--debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG]
14+
-h, --help Get help on this command.
15+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
16+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried.
17+
[env: COVERAGE_RCFILE]
18+

doc/help/erase.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
.. code::
3+
4+
$ coverage erase --help
5+
Usage: coverage erase [options]
6+
7+
Erase previously collected coverage data.
8+
9+
Options:
10+
--debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG]
11+
-h, --help Get help on this command.
12+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
13+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried.
14+
[env: COVERAGE_RCFILE]
15+

doc/help/html.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
.. code::
3+
4+
$ coverage html --help
5+
Usage: coverage html [options] [modules]
6+
7+
Create an HTML report of the coverage of the files. Each file gets its own
8+
page, with the source decorated to show executed, excluded, and missed lines.
9+
10+
Options:
11+
--contexts=REGEX1,REGEX2,...
12+
Only display data from lines covered in the given
13+
contexts. Accepts Python regexes, which must be
14+
quoted.
15+
-d DIR, --directory=DIR
16+
Write the output files to DIR.
17+
--fail-under=MIN Exit with a status of 2 if the total coverage is less
18+
than MIN.
19+
-i, --ignore-errors Ignore errors while reading source files.
20+
--include=PAT1,PAT2,...
21+
Include only files whose paths match one of these
22+
patterns. Accepts shell-style wildcards, which must be
23+
quoted.
24+
--omit=PAT1,PAT2,... Omit files whose paths match one of these patterns.
25+
Accepts shell-style wildcards, which must be quoted.
26+
--precision=N Number of digits after the decimal point to display
27+
for reported coverage percentages.
28+
--show-contexts Show contexts for covered lines.
29+
--skip-covered Skip files with 100% coverage.
30+
--no-skip-covered Disable --skip-covered.
31+
--skip-empty Skip files with no code.
32+
--title=TITLE A text string to use as the title on the HTML.
33+
--debug=OPTS Debug options, separated by commas. [env:
34+
COVERAGE_DEBUG]
35+
-h, --help Get help on this command.
36+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
37+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
38+
tried. [env: COVERAGE_RCFILE]
39+

doc/help/json.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
.. code::
3+
4+
$ coverage json --help
5+
Usage: coverage json [options] [modules]
6+
7+
Generate a JSON report of coverage results.
8+
9+
Options:
10+
--contexts=REGEX1,REGEX2,...
11+
Only display data from lines covered in the given
12+
contexts. Accepts Python regexes, which must be
13+
quoted.
14+
--fail-under=MIN Exit with a status of 2 if the total coverage is less
15+
than MIN.
16+
-i, --ignore-errors Ignore errors while reading source files.
17+
--include=PAT1,PAT2,...
18+
Include only files whose paths match one of these
19+
patterns. Accepts shell-style wildcards, which must be
20+
quoted.
21+
--omit=PAT1,PAT2,... Omit files whose paths match one of these patterns.
22+
Accepts shell-style wildcards, which must be quoted.
23+
-o OUTFILE Write the JSON report to this file. Defaults to
24+
'coverage.json'
25+
--pretty-print Format the JSON for human readers.
26+
--show-contexts Show contexts for covered lines.
27+
--debug=OPTS Debug options, separated by commas. [env:
28+
COVERAGE_DEBUG]
29+
-h, --help Get help on this command.
30+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
31+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
32+
tried. [env: COVERAGE_RCFILE]
33+

doc/help/report.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
.. code::
3+
4+
$ coverage report --help
5+
Usage: coverage report [options] [modules]
6+
7+
Report coverage statistics on modules.
8+
9+
Options:
10+
--contexts=REGEX1,REGEX2,...
11+
Only display data from lines covered in the given
12+
contexts. Accepts Python regexes, which must be
13+
quoted.
14+
--fail-under=MIN Exit with a status of 2 if the total coverage is less
15+
than MIN.
16+
-i, --ignore-errors Ignore errors while reading source files.
17+
--include=PAT1,PAT2,...
18+
Include only files whose paths match one of these
19+
patterns. Accepts shell-style wildcards, which must be
20+
quoted.
21+
--omit=PAT1,PAT2,... Omit files whose paths match one of these patterns.
22+
Accepts shell-style wildcards, which must be quoted.
23+
--precision=N Number of digits after the decimal point to display
24+
for reported coverage percentages.
25+
--sort=COLUMN Sort the report by the named column: name, stmts,
26+
miss, branch, brpart, or cover. Default is name.
27+
-m, --show-missing Show line numbers of statements in each module that
28+
weren't executed.
29+
--skip-covered Skip files with 100% coverage.
30+
--no-skip-covered Disable --skip-covered.
31+
--skip-empty Skip files with no code.
32+
--debug=OPTS Debug options, separated by commas. [env:
33+
COVERAGE_DEBUG]
34+
-h, --help Get help on this command.
35+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
36+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
37+
tried. [env: COVERAGE_RCFILE]
38+

doc/help/run.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
.. code::
3+
4+
$ coverage run --help
5+
Usage: coverage run [options] <pyfile> [program options]
6+
7+
Run a Python program, measuring code execution.
8+
9+
Options:
10+
-a, --append Append coverage data to .coverage, otherwise it starts
11+
clean each time.
12+
--branch Measure branch coverage in addition to statement
13+
coverage.
14+
--concurrency=LIB Properly measure code using a concurrency library.
15+
Valid values are: thread, gevent, greenlet, eventlet,
16+
multiprocessing.
17+
--context=LABEL The context label to record for this coverage run.
18+
--include=PAT1,PAT2,...
19+
Include only files whose paths match one of these
20+
patterns. Accepts shell-style wildcards, which must be
21+
quoted.
22+
-m, --module <pyfile> is an importable Python module, not a script
23+
path, to be run as 'python -m' would run it.
24+
--omit=PAT1,PAT2,... Omit files whose paths match one of these patterns.
25+
Accepts shell-style wildcards, which must be quoted.
26+
-L, --pylib Measure coverage even inside the Python installed
27+
library, which isn't done by default.
28+
-p, --parallel-mode Append the machine name, process id and random number
29+
to the .coverage data file name to simplify collecting
30+
data from many processes.
31+
--source=SRC1,SRC2,...
32+
A list of packages or directories of code to be
33+
measured.
34+
--timid Use a simpler but slower trace method. Try this if you
35+
get seemingly impossible results!
36+
--debug=OPTS Debug options, separated by commas. [env:
37+
COVERAGE_DEBUG]
38+
-h, --help Get help on this command.
39+
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
40+
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
41+
tried. [env: COVERAGE_RCFILE]
42+

0 commit comments

Comments
 (0)