diff --git a/dvc/command/add.py b/dvc/command/add.py index 45c74c06f..16b3b979e 100644 --- a/dvc/command/add.py +++ b/dvc/command/add.py @@ -57,6 +57,6 @@ def add_parser(subparsers, parent_parser): "-f", "--file", help="Specify name of the DVC-file it generates." ) add_parser.add_argument( - "targets", nargs="+", help="Input files/directories." + "targets", nargs="+", help="Input files/directories to add." ) add_parser.set_defaults(func=CmdAdd) diff --git a/dvc/command/checkout.py b/dvc/command/checkout.py index 6637140b2..5d1941587 100644 --- a/dvc/command/checkout.py +++ b/dvc/command/checkout.py @@ -51,5 +51,10 @@ def add_parser(subparsers, parent_parser): default=False, help="Checkout all subdirectories of the specified directory.", ) - checkout_parser.add_argument("targets", nargs="*", help="DVC-files.") + checkout_parser.add_argument( + "targets", + nargs="*", + help="DVC-files to checkout. Optional. " + "(Finds all DVC-files in the workspace by default.)", + ) checkout_parser.set_defaults(func=CmdCheckout) diff --git a/dvc/command/commit.py b/dvc/command/commit.py index 8ba3b99f3..daa4d2474 100644 --- a/dvc/command/commit.py +++ b/dvc/command/commit.py @@ -65,6 +65,9 @@ def add_parser(subparsers, parent_parser): help="Commit cache for subdirectories of the specified directory.", ) commit_parser.add_argument( - "targets", nargs="*", default=None, help="DVC-files." + "targets", + nargs="*", + help="DVC-files to commit. Optional. " + "(Finds all DVC-files in the workspace by default.)", ) commit_parser.set_defaults(func=CmdCommit) diff --git a/dvc/command/data_sync.py b/dvc/command/data_sync.py index 6295f4c4d..17bebcb38 100644 --- a/dvc/command/data_sync.py +++ b/dvc/command/data_sync.py @@ -116,11 +116,8 @@ def shared_parent_parser(): shared_parent_parser.add_argument( "targets", nargs="*", - default=None, - help=( - "Limit the scope to these DVC-files." - " With -R a directory to search DVC-files in can be specified." - ), + help="Limit command scope to these DVC-files. " + "Using -R, directories to search DVC-files in can also be given.", ) return shared_parent_parser diff --git a/dvc/command/diff.py b/dvc/command/diff.py index 901223d04..b62ef1c29 100644 --- a/dvc/command/diff.py +++ b/dvc/command/diff.py @@ -157,7 +157,7 @@ def add_parser(subparsers, parent_parser): diff_parser.add_argument( "b_ref", help=( - "Git reference untill which diff calculates, if omitted " + "Git reference until which diff calculates, if omitted " "diff shows the difference between current HEAD and a_ref" ), nargs="?", diff --git a/dvc/command/lock.py b/dvc/command/lock.py index e934380ed..da672c352 100644 --- a/dvc/command/lock.py +++ b/dvc/command/lock.py @@ -37,7 +37,7 @@ class CmdUnlock(CmdLockBase): def add_parser(subparsers, parent_parser): - LOCK_HELP = "Lock DVC-file." + LOCK_HELP = "Lock DVC-files." lock_parser = subparsers.add_parser( "lock", parents=[parent_parser], @@ -45,10 +45,10 @@ def add_parser(subparsers, parent_parser): help=LOCK_HELP, formatter_class=argparse.RawDescriptionHelpFormatter, ) - lock_parser.add_argument("targets", nargs="+", help="DVC-files.") + lock_parser.add_argument("targets", nargs="+", help="DVC-files to lock.") lock_parser.set_defaults(func=CmdLock) - UNLOCK_HELP = "Unlock DVC-file." + UNLOCK_HELP = "Unlock DVC-files." unlock_parser = subparsers.add_parser( "unlock", parents=[parent_parser], @@ -56,5 +56,7 @@ def add_parser(subparsers, parent_parser): help=UNLOCK_HELP, formatter_class=argparse.RawDescriptionHelpFormatter, ) - unlock_parser.add_argument("targets", nargs="+", help="DVC-files.") + unlock_parser.add_argument( + "targets", nargs="+", help="DVC-files to unlock." + ) unlock_parser.set_defaults(func=CmdUnlock) diff --git a/dvc/command/pipeline.py b/dvc/command/pipeline.py index 70b8bd79d..8b7bc2f40 100644 --- a/dvc/command/pipeline.py +++ b/dvc/command/pipeline.py @@ -197,7 +197,7 @@ def add_parser(subparsers, parent_parser): fix_subparsers(pipeline_subparsers) - PIPELINE_SHOW_HELP = "Show pipeline." + PIPELINE_SHOW_HELP = "Show pipelines." pipeline_show_parser = pipeline_subparsers.add_parser( "show", parents=[parent_parser], @@ -246,7 +246,10 @@ def add_parser(subparsers, parent_parser): help="Output DAG as Dependencies Tree.", ) pipeline_show_parser.add_argument( - "targets", nargs="*", help="DVC-files. 'Dvcfile' by default." + "targets", + nargs="*", + help="DVC-files to show pipeline for. Optional. " + "(Finds all DVC-files in the workspace by default.)", ) pipeline_show_parser.set_defaults(func=CmdPipelineShow) diff --git a/dvc/command/remote.py b/dvc/command/remote.py index 4e0415556..490bbbe48 100644 --- a/dvc/command/remote.py +++ b/dvc/command/remote.py @@ -89,7 +89,7 @@ def add_parser(subparsers, parent_parser): help=REMOTE_ADD_HELP, formatter_class=argparse.RawDescriptionHelpFormatter, ) - remote_add_parser.add_argument("name", help="Name.") + remote_add_parser.add_argument("name", help="Name of the remote") remote_add_parser.add_argument( "url", help="URL. See full list of supported urls at " "man.dvc.org/remote", @@ -138,7 +138,9 @@ def add_parser(subparsers, parent_parser): help=REMOTE_REMOVE_HELP, formatter_class=argparse.RawDescriptionHelpFormatter, ) - remote_remove_parser.add_argument("name", help="Name") + remote_remove_parser.add_argument( + "name", help="Name of the remote to remove." + ) remote_remove_parser.set_defaults(func=CmdRemoteRemove) REMOTE_MODIFY_HELP = "Modify remote." @@ -149,9 +151,13 @@ def add_parser(subparsers, parent_parser): help=REMOTE_MODIFY_HELP, formatter_class=argparse.RawDescriptionHelpFormatter, ) - remote_modify_parser.add_argument("name", help="Name.") - remote_modify_parser.add_argument("option", help="Option.") - remote_modify_parser.add_argument("value", nargs="?", help="Value.") + remote_modify_parser.add_argument("name", help="Name of the remote.") + remote_modify_parser.add_argument( + "option", help="Name of the option to modify." + ) + remote_modify_parser.add_argument( + "value", nargs="?", help="(optional) Value of the option." + ) remote_modify_parser.add_argument( "-u", "--unset", diff --git a/dvc/command/remove.py b/dvc/command/remove.py index 4a006a575..b8e98200c 100644 --- a/dvc/command/remove.py +++ b/dvc/command/remove.py @@ -43,7 +43,7 @@ class CmdRemove(CmdBase): def add_parser(subparsers, parent_parser): - REMOVE_HELP = "Remove outputs of DVC-file." + REMOVE_HELP = "Remove DVC-file outputs." remove_parser = subparsers.add_parser( "remove", parents=[parent_parser], @@ -73,5 +73,10 @@ def add_parser(subparsers, parent_parser): default=False, help="Force purge.", ) - remove_parser.add_argument("targets", nargs="+", help="DVC-files.") + remove_parser.add_argument( + "targets", + nargs="+", + help="DVC-files to remove. Optional. " + "(Finds all DVC-files in the workspace by default.)", + ) remove_parser.set_defaults(func=CmdRemove) diff --git a/dvc/command/repro.py b/dvc/command/repro.py index 3c7ee2f21..707657139 100644 --- a/dvc/command/repro.py +++ b/dvc/command/repro.py @@ -58,7 +58,7 @@ class CmdRepro(CmdBase): def add_parser(subparsers, parent_parser): - REPRO_HELP = "Check for changes and reproduce DVC-file and dependencies." + REPRO_HELP = "Check for changes and reproduce stages and dependencies." repro_parser = subparsers.add_parser( "repro", parents=[parent_parser], @@ -69,7 +69,7 @@ def add_parser(subparsers, parent_parser): repro_parser.add_argument( "targets", nargs="*", - help="DVC-file to reproduce (default - 'Dvcfile').", + help="DVC-file to reproduce. 'Dvcfile' by default.", ) repro_parser.add_argument( "-f", diff --git a/dvc/command/unprotect.py b/dvc/command/unprotect.py index e62848992..b4b276234 100644 --- a/dvc/command/unprotect.py +++ b/dvc/command/unprotect.py @@ -23,7 +23,7 @@ class CmdUnprotect(CmdBase): def add_parser(subparsers, parent_parser): - UNPROTECT_HELP = "Unprotect a data file/directory." + UNPROTECT_HELP = "Unprotect data files or directories." unprotect_parser = subparsers.add_parser( "unprotect", parents=[parent_parser], @@ -32,6 +32,6 @@ def add_parser(subparsers, parent_parser): formatter_class=argparse.RawDescriptionHelpFormatter, ) unprotect_parser.add_argument( - "targets", nargs="+", help="Data files/directory." + "targets", nargs="+", help="Data files/directories to unprotect." ) unprotect_parser.set_defaults(func=CmdUnprotect) diff --git a/dvc/exceptions.py b/dvc/exceptions.py index 870dbd542..c5496fa4e 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -62,7 +62,7 @@ class OutputNotFoundError(DvcException): def __init__(self, output): super(OutputNotFoundError, self).__init__( - "unable to find stage file with output '{path}'".format( + "unable to find DVC-file with output '{path}'".format( path=relpath(output) ) ) @@ -74,7 +74,7 @@ class StagePathAsOutputError(DvcException): Args: cwd (str): path to the directory. - fname (str): path to the stage file that has cwd specified as an + fname (str): path to the DVC-file that has cwd specified as an output. """ @@ -216,7 +216,7 @@ class StageFileCorruptedError(DvcException): def __init__(self, path, cause=None): path = relpath(path) super(StageFileCorruptedError, self).__init__( - "unable to read stage file: {} " + "unable to read DVC-file: {} " "YAML file structure is corrupted".format(path), cause=cause, ) diff --git a/dvc/repo/add.py b/dvc/repo/add.py index 2cb3dad0c..0b02a19ab 100644 --- a/dvc/repo/add.py +++ b/dvc/repo/add.py @@ -22,7 +22,7 @@ def add(repo, target, recursive=False, no_commit=False, fname=None): logger.warning( "You are adding a large directory '{target}' recursively," " consider tracking it as a whole instead.\n" - "{purple}HINT:{nc} Remove the generated stage files and then" + "{purple}HINT:{nc} Remove the generated DVC-file and then" " run {cyan}dvc add {target}{nc}".format( purple=colorama.Fore.MAGENTA, cyan=colorama.Fore.CYAN, diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index 6ce9f8e71..758ba3a47 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -177,7 +177,7 @@ def _collect_metrics(repo, path, recursive, typ, xpath, branch): outs = repo.find_outs_by_path(path, outs=outs, recursive=recursive) except OutputNotFoundError: logger.debug( - "stage file not for found for '{}' in branch '{}'".format( + "DVC-file not for found for '{}' in branch '{}'".format( path, branch ) ) diff --git a/dvc/repo/move.py b/dvc/repo/move.py index 7b5dd6c61..ea190fe61 100644 --- a/dvc/repo/move.py +++ b/dvc/repo/move.py @@ -17,7 +17,7 @@ def move(self, from_path, to_path): to reflect the change on the pipeline. If the output has the same name as its stage, it would - also rename the corresponding stage file. + also rename the corresponding DVC-file. E.g. Having: (hello, hello.dvc) diff --git a/dvc/stage.py b/dvc/stage.py index 5abc53e54..c88d5b978 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -35,7 +35,7 @@ class StageCmdFailedError(DvcException): class StageFileFormatError(DvcException): def __init__(self, fname, e): - msg = "stage file '{}' format error: {}".format(fname, str(e)) + msg = "DVC-file '{}' format error: {}".format(fname, str(e)) super(StageFileFormatError, self).__init__(msg) @@ -183,7 +183,7 @@ class Stage(object): @property def is_data_source(self): - """Whether the stage file was created with `dvc add` or `dvc import`""" + """Whether the DVC-file was created with `dvc add` or `dvc import`""" return self.cmd is None @staticmethod @@ -213,7 +213,7 @@ class Stage(object): @property def is_import(self): - """Whether the stage file was created with `dvc import`.""" + """Whether the DVC-file was created with `dvc import`.""" return not self.cmd and len(self.deps) == 1 and len(self.outs) == 1 @property @@ -453,9 +453,9 @@ class Stage(object): if wdir is None and cwd is not None: if fname is not None and os.path.basename(fname) != fname: raise StageFileBadNameError( - "stage file name '{fname}' may not contain subdirectories" + "DVC-file name '{fname}' may not contain subdirectories" " if '-c|--cwd' (deprecated) is specified. Use '-w|--wdir'" - " along with '-f' to specify stage file path and working" + " along with '-f' to specify DVC-file path with working" " directory.".format(fname=fname) ) wdir = cwd @@ -559,7 +559,7 @@ class Stage(object): def _check_dvc_filename(fname): if not Stage.is_valid_filename(fname): raise StageFileBadNameError( - "bad stage filename '{}'. Stage files should be named" + "bad DVC-file name '{}'. DVC-files should be named" " 'Dvcfile' or have a '.dvc' suffix (e.g. '{}.dvc').".format( relpath(fname), os.path.basename(fname) ) @@ -663,10 +663,10 @@ class Stage(object): if self.PARAM_MD5 in d.keys(): del d[self.PARAM_MD5] - # Ignore the wdir default value. In this case stage file w/o + # Ignore the wdir default value. In this case DVC-file w/o # wdir has the same md5 as a file with the default value specified. # It's important for backward compatibility with pipelines that - # didn't have WDIR in their stage files. + # didn't have WDIR in their DVC-files. if d.get(self.PARAM_WDIR) == ".": del d[self.PARAM_WDIR] diff --git a/scripts/completion/dvc.zsh b/scripts/completion/dvc.zsh index 0faddee63..8bcd382ca 100644 --- a/scripts/completion/dvc.zsh +++ b/scripts/completion/dvc.zsh @@ -144,7 +144,7 @@ _dvc_move=( ) _dvc_pipeline=( - "1:Sub command:(show,list)" + "1:Sub command:(show list)" ) _dvc_pull=( diff --git a/tests/func/test_add.py b/tests/func/test_add.py index 122a06ec0..2c1aa2927 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -96,7 +96,7 @@ class TestAddCmdDirectoryRecursive(TestDvc): warning = ( "You are adding a large directory 'large-dir' recursively," " consider tracking it as a whole instead.\n" - "{purple}HINT:{nc} Remove the generated stage files and then" + "{purple}HINT:{nc} Remove the generated DVC-file and then" " run {cyan}dvc add large-dir{nc}".format( purple=colorama.Fore.MAGENTA, cyan=colorama.Fore.CYAN, @@ -434,7 +434,7 @@ class TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc): assert 1 == ret expected_error = ( - "unable to read stage file: {} " + "unable to read DVC-file: {} " "YAML file structure is corrupted".format(foo_stage) ) @@ -475,6 +475,7 @@ class TestShouldCleanUpAfterFailedAdd(TestDvcGit): self.assertEqual(0, ret) foo_stage_file = self.FOO + Stage.STAGE_FILE_SUFFIX + # corrupt stage file with open(foo_stage_file, "a+") as file: file.write("this will break yaml file structure") diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index d01dfd656..1185d733c 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -1558,7 +1558,7 @@ def test_dvc_formatting_retained(dvc_repo, foo_copy): root = pathlib.Path(dvc_repo.root_dir) stage_file = root / foo_copy["stage_fname"] - # Add comments and custom formatting to stage file + # Add comments and custom formatting to DVC-file lines = list(map(_format_dvc_line, stage_file.read_text().splitlines())) lines.insert(0, "# Starting comment") stage_text = "".join(l + "\n" for l in lines) diff --git a/tests/func/test_stage.py b/tests/func/test_stage.py index 6c56a1a53..fa18160d8 100644 --- a/tests/func/test_stage.py +++ b/tests/func/test_stage.py @@ -172,7 +172,7 @@ def test_md5_ignores_comments(repo_dir, dvc_repo): def test_meta_is_preserved(dvc_repo): stage, = dvc_repo.add("foo") - # Add meta to stage file + # Add meta to DVC-file data = load_stage_file(stage.path) data["meta"] = {"custom_key": 42} dump_stage_file(stage.path, data)