summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
diff options
context:
space:
mode:
authorstepeos <82703776+stepeos@users.noreply.github.com>2022-11-05 17:29:04 +0100
committerGitHub <noreply@github.com>2022-11-05 09:29:04 -0700
commitcf1efa814e905ab1e2bc17795b1dbe6d437b39e5 (patch)
treee7f236575db700b37b595669bd8dbe803b1b53d4 /coverage/cmdline.py
parent27fd4a9b8999dba408d1bc5a5df675d7caaa85b8 (diff)
downloadpython-coveragepy-git-cf1efa814e905ab1e2bc17795b1dbe6d437b39e5.tar.gz
feat: report terminal output in Markdown Table format #1418 (#1479)
* refactoring normal reporting text output * implemented markdown feature from #1418 * minor changes * fixed text output * fixed precision for text and markdown report format * minor changes * finished testing for markdown format feature * fixed testing outside test_summary.py * removed fixed-length widespace padding for tests * removed whitespaces * refactoring, fixing docs, rewriting cmd args * fixing code quality * implementing requested changes * doc fix * test: add another test of correct report formatting * fixed precision printing test * style: adjust the formatting Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r--coverage/cmdline.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 65ee73f8..89b0807d 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -96,6 +96,10 @@ class Opts:
'', '--fail-under', action='store', metavar="MIN", type="float",
help="Exit with a status of 2 if the total coverage is less than MIN.",
)
+ output_format = optparse.make_option(
+ '', '--format', action='store', metavar="FORMAT", dest="output_format",
+ help="Output format, either text (default) or markdown",
+ )
help = optparse.make_option(
'-h', '--help', action='store_true',
help="Get help on this command.",
@@ -245,6 +249,7 @@ class CoverageOptionParser(optparse.OptionParser):
debug=None,
directory=None,
fail_under=None,
+ output_format=None,
help=None,
ignore_errors=None,
include=None,
@@ -482,6 +487,7 @@ COMMANDS = {
Opts.contexts,
Opts.input_datafile,
Opts.fail_under,
+ Opts.output_format,
Opts.ignore_errors,
Opts.include,
Opts.omit,
@@ -689,6 +695,7 @@ class CoverageScript:
skip_covered=options.skip_covered,
skip_empty=options.skip_empty,
sort=options.sort,
+ output_format=options.output_format,
**report_args
)
elif options.action == "annotate":