From 820ad50df8e9525e59e6431a2cd88f727ccbae43 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Thu, 27 Jun 2019 18:39:46 -0500 Subject: [PATCH] commands: remove `default=None` from argparse `add_argument` calls Per https://github.com/iterative/dvc/pull/2112#pullrequestreview-255013079 --- dvc/command/cache.py | 1 - dvc/command/config.py | 4 +--- dvc/command/data_sync.py | 6 +----- dvc/command/diff.py | 2 -- dvc/command/gc.py | 7 +------ dvc/command/run.py | 3 +-- 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/dvc/command/cache.py b/dvc/command/cache.py index 75222a505..8110ad18e 100644 --- a/dvc/command/cache.py +++ b/dvc/command/cache.py @@ -57,7 +57,6 @@ def add_parser(subparsers, parent_parser): ) cache_dir_parser.add_argument( "value", - default=None, help="Path to cache directory. Relative paths are resolved relative " "to the current directory and saved to config relative to the " "config file location.", diff --git a/dvc/command/config.py b/dvc/command/config.py index 8e3bdba40..de9f8bd58 100644 --- a/dvc/command/config.py +++ b/dvc/command/config.py @@ -74,7 +74,5 @@ def add_parser(subparsers, parent_parser): help="Unset option.", ) config_parser.add_argument("name", help="Option name.") - config_parser.add_argument( - "value", nargs="?", default=None, help="Option value." - ) + config_parser.add_argument("value", nargs="?", help="Option value.") config_parser.set_defaults(func=CmdConfig) diff --git a/dvc/command/data_sync.py b/dvc/command/data_sync.py index 17bebcb38..91748b102 100644 --- a/dvc/command/data_sync.py +++ b/dvc/command/data_sync.py @@ -101,11 +101,7 @@ def shared_parent_parser(): add_help=False, parents=[get_parent_parser()] ) shared_parent_parser.add_argument( - "-j", - "--jobs", - type=int, - default=None, - help="Number of jobs to run simultaneously.", + "-j", "--jobs", type=int, help="Number of jobs to run simultaneously." ) shared_parent_parser.add_argument( "--show-checksums", diff --git a/dvc/command/diff.py b/dvc/command/diff.py index b62ef1c29..149d85451 100644 --- a/dvc/command/diff.py +++ b/dvc/command/diff.py @@ -144,7 +144,6 @@ def add_parser(subparsers, parent_parser): diff_parser.add_argument( "-t", "--target", - default=None, help=( "Source path to a data file or directory. Default None. " "If not specified, compares all files and directories " @@ -161,6 +160,5 @@ def add_parser(subparsers, parent_parser): "diff shows the difference between current HEAD and a_ref" ), nargs="?", - default=None, ) diff_parser.set_defaults(func=CmdDiff) diff --git a/dvc/command/gc.py b/dvc/command/gc.py index dc3b191fe..27e756c54 100644 --- a/dvc/command/gc.py +++ b/dvc/command/gc.py @@ -94,11 +94,7 @@ def add_parser(subparsers, parent_parser): help="Force garbage collection - automatically agree to all prompts.", ) gc_parser.add_argument( - "-j", - "--jobs", - type=int, - default=None, - help="Number of jobs to run simultaneously.", + "-j", "--jobs", type=int, help="Number of jobs to run simultaneously." ) gc_parser.add_argument( "-p", @@ -106,7 +102,6 @@ def add_parser(subparsers, parent_parser): dest="repos", type=str, nargs="*", - default=None, help="Keep data files required by these projects " "in addition to the current one. " "Useful if you share a single cache across repos.", diff --git a/dvc/command/run.py b/dvc/command/run.py index 6afbc5073..1c3c3f457 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -130,12 +130,11 @@ def add_parser(subparsers, parent_parser): "-f", "--file", help="Specify name of the DVC-file it generates." ) run_parser.add_argument( - "-c", "--cwd", default=None, help="Deprecated, use -w and -f instead." + "-c", "--cwd", help="Deprecated, use -w and -f instead." ) run_parser.add_argument( "-w", "--wdir", - default=None, help="Directory within your repo to run your command in.", ) run_parser.add_argument(