diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-26 07:02:47 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-26 07:54:42 -0400 |
commit | 8e8fdb4308c56375a1463fa65de7e84303610522 (patch) | |
tree | c61d3755027f2d09019a6c52fe2523ab815f905e /coverage/cmdline.py | |
parent | 07c4498f8c6bfd5de0248dd8e7c2328e81f728d1 (diff) | |
download | python-coveragepy-git-8e8fdb4308c56375a1463fa65de7e84303610522.tar.gz |
refactor: alphabetize the options
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r-- | coverage/cmdline.py | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 5f972035..81b87edf 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -55,6 +55,14 @@ class Opts: '', '--context', action='store', metavar="LABEL", help="The context label to record for this coverage run.", ) + contexts = optparse.make_option( + '', '--contexts', action='store', + metavar="REGEX1,REGEX2,...", + help=( + "Only display data from lines covered in the given contexts. " + + "Accepts Python regexes, which must be quoted." + ), + ) debug = optparse.make_option( '', '--debug', action='store', metavar="OPTS", help="Debug options, separated by commas. [env: COVERAGE_DEBUG]", @@ -90,30 +98,16 @@ class Opts: "which isn't done by default." ), ) - sort = optparse.make_option( - '--sort', action='store', metavar='COLUMN', - help="Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. " + - "Default is name." - ) show_missing = optparse.make_option( '-m', '--show-missing', action='store_true', help="Show line numbers of statements in each module that weren't executed.", ) - skip_covered = optparse.make_option( - '--skip-covered', action='store_true', - help="Skip files with 100% coverage.", - ) - no_skip_covered = optparse.make_option( - '--no-skip-covered', action='store_false', dest='skip_covered', - help="Disable --skip-covered.", - ) - skip_empty = optparse.make_option( - '--skip-empty', action='store_true', - help="Skip files with no code.", - ) - show_contexts = optparse.make_option( - '--show-contexts', action='store_true', - help="Show contexts for covered lines.", + module = optparse.make_option( + '-m', '--module', action='store_true', + help=( + "<pyfile> is an importable Python module, not a script path, " + + "to be run as 'python -m' would run it." + ), ) omit = optparse.make_option( '', '--omit', action='store', @@ -123,14 +117,6 @@ class Opts: "Accepts shell-style wildcards, which must be quoted." ), ) - contexts = optparse.make_option( - '', '--contexts', action='store', - metavar="REGEX1,REGEX2,...", - help=( - "Only display data from lines covered in the given contexts. " + - "Accepts Python regexes, which must be quoted." - ), - ) output_xml = optparse.make_option( '-o', '', action='store', dest="outfile", metavar="OUTFILE", @@ -153,13 +139,6 @@ class Opts: "many processes." ), ) - module = optparse.make_option( - '-m', '--module', action='store_true', - help=( - "<pyfile> is an importable Python module, not a script path, " + - "to be run as 'python -m' would run it." - ), - ) precision = optparse.make_option( '', '--precision', action='store', metavar='N', type=int, help=( @@ -175,6 +154,27 @@ class Opts: "'pyproject.toml' are tried. [env: COVERAGE_RCFILE]" ), ) + show_contexts = optparse.make_option( + '--show-contexts', action='store_true', + help="Show contexts for covered lines.", + ) + skip_covered = optparse.make_option( + '--skip-covered', action='store_true', + help="Skip files with 100% coverage.", + ) + no_skip_covered = optparse.make_option( + '--no-skip-covered', action='store_false', dest='skip_covered', + help="Disable --skip-covered.", + ) + skip_empty = optparse.make_option( + '--skip-empty', action='store_true', + help="Skip files with no code.", + ) + sort = optparse.make_option( + '--sort', action='store', metavar='COLUMN', + help="Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. " + + "Default is name." + ) source = optparse.make_option( '', '--source', action='store', metavar="SRC1,SRC2,...", help="A list of directories or importable names of code to measure.", @@ -214,6 +214,7 @@ class CoverageOptionParser(optparse.OptionParser): branch=None, concurrency=None, context=None, + contexts=None, debug=None, directory=None, fail_under=None, @@ -223,15 +224,14 @@ class CoverageOptionParser(optparse.OptionParser): keep=None, module=None, omit=None, - contexts=None, parallel_mode=None, precision=None, pylib=None, rcfile=True, + show_contexts=None, show_missing=None, skip_covered=None, skip_empty=None, - show_contexts=None, sort=None, source=None, timid=None, |