diff --git a/dvc/command/destroy.py b/dvc/command/destroy.py index ca739de4ae..3dc2513875 100644 --- a/dvc/command/destroy.py +++ b/dvc/command/destroy.py @@ -24,7 +24,7 @@ def run(self): if not self.args.force and not prompt.confirm(statement): raise DvcException( "cannot destroy without a confirmation from the user." - " Use '-f' to force." + " Use `-f` to force." ) self.repo.destroy() diff --git a/dvc/command/imp_url.py b/dvc/command/imp_url.py index 012ea80c0e..1b0b1cf87c 100644 --- a/dvc/command/imp_url.py +++ b/dvc/command/imp_url.py @@ -19,7 +19,7 @@ def run(self): except DvcException: logger.exception( "failed to import {}. You could also try downloading " - "it manually and adding it with `dvc add` command.".format( + "it manually, and adding it with `dvc add`.".format( self.args.url ) ) diff --git a/dvc/command/init.py b/dvc/command/init.py index 0e9bdf83f8..075e3be4c0 100644 --- a/dvc/command/init.py +++ b/dvc/command/init.py @@ -53,7 +53,7 @@ def add_parser(subparsers, parent_parser): action="store_true", default=False, help=( - "Overwrite existing '.dvc' directory. " + "Overwrite existing '.dvc/' directory. " "This operation removes local cache." ), ) diff --git a/dvc/command/remove.py b/dvc/command/remove.py index 814adcfae3..a004480290 100644 --- a/dvc/command/remove.py +++ b/dvc/command/remove.py @@ -28,7 +28,7 @@ def _is_outs_only(self, target): raise DvcException( "Cannot purge without a confirmation from the user." - " Use '-f' to force." + " Use `-f` to force." ) def run(self): diff --git a/dvc/command/run.py b/dvc/command/run.py index b0761435f3..c51f10baba 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -27,9 +27,9 @@ def run(self): ] ): # pragma: no cover logger.error( - "too few arguments. Specify at least one: '-d', '-o', '-O'," - " '-m', '-M', '--outs-persist', '--outs-persist-no-cache'," - " 'command'." + "too few arguments. Specify at least one: `-d`, `-o`, `-O`, " + "`-m`, `-M`, `--outs-persist`, `--outs-persist-no-cache`, " + "`command`." ) return 1 diff --git a/dvc/exceptions.py b/dvc/exceptions.py index 2309bcdbf8..16b8b837b3 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -179,7 +179,7 @@ class ConfirmRemoveError(DvcException): def __init__(self, path): super(ConfirmRemoveError, self).__init__( "unable to remove '{}' without a confirmation from the user. Use " - "'-f' to force.".format(path) + "`-f` to force.".format(path) ) @@ -209,7 +209,7 @@ class NoMetricsError(DvcException): def __init__(self): super(NoMetricsError, self).__init__( "no metric files in this repository. " - "Use 'dvc metrics add' to add a metric file to track." + "Use `dvc metrics add` to add a metric file to track." ) @@ -247,7 +247,7 @@ def __init__(self, out_1, out_2): class CheckoutErrorSuggestGit(DvcException): def __init__(self, target, cause): super(CheckoutErrorSuggestGit, self).__init__( - "Did you mean 'git checkout {}'?".format(target), cause=cause + "Did you mean `git checkout {}`?".format(target), cause=cause ) diff --git a/dvc/remote/slow_link_detection.py b/dvc/remote/slow_link_detection.py index 0dd2285d60..bffa6e9e8a 100644 --- a/dvc/remote/slow_link_detection.py +++ b/dvc/remote/slow_link_detection.py @@ -18,7 +18,7 @@ "See {blue}https://dvc.org/doc/commands-reference/config#cache{reset} " "for more information.\n" "To disable this message, run:\n" - "'dvc config cache.slow_link_warning false'".format( + "`dvc config cache.slow_link_warning false`".format( blue=colorama.Fore.BLUE, reset=colorama.Fore.RESET ) ) diff --git a/dvc/repo/init.py b/dvc/repo/init.py index 19dc20d1bf..e2f6b4702a 100644 --- a/dvc/repo/init.py +++ b/dvc/repo/init.py @@ -65,7 +65,7 @@ def init(root_dir=os.curdir, no_scm=False, force=False): if isinstance(scm, NoSCM) and not no_scm: raise InitError( "{repo} is not tracked by any supported scm tool (e.g. git). " - "Use '--no-scm' if you don't want to use any scm.".format( + "Use `--no-scm` if you don't want to use any scm.".format( repo=root_dir ) ) @@ -73,7 +73,7 @@ def init(root_dir=os.curdir, no_scm=False, force=False): if os.path.isdir(dvc_dir): if not force: raise InitError( - "'{repo}' exists. Use '-f' to force.".format( + "'{repo}' exists. Use `-f` to force.".format( repo=relpath(dvc_dir) ) ) diff --git a/dvc/scm/git/__init__.py b/dvc/scm/git/__init__.py index 05bb2faf10..fd4e7ad10f 100644 --- a/dvc/scm/git/__init__.py +++ b/dvc/scm/git/__init__.py @@ -200,10 +200,10 @@ def add(self, paths): self.repo.index.add(paths) except AssertionError: msg = ( - "failed to add '{}' to git. You can add those files" - " manually using 'git add'." - " See 'https://github.com/iterative/dvc/issues/610'" - " for more details.".format(str(paths)) + "failed to add '{}' to git. You can add those files " + "manually using `git add`. See " + "https://github.com/iterative/dvc/issues/610 for more " + "details.".format(str(paths)) ) logger.exception(msg) diff --git a/dvc/stage.py b/dvc/stage.py index 4d3b7d3d0e..94ec95c210 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -242,7 +242,7 @@ def _changed_deps(self): if self.is_callback: logger.warning( - "DVC-file '{fname}' is a 'callback' stage " + "DVC-file '{fname}' is a \"callback\" stage " "(has a command and no dependencies) and thus always " "considered as changed.".format(fname=self.relpath) ) @@ -451,8 +451,8 @@ def create(repo, **kwargs): if fname is not None and os.path.basename(fname) != fname: raise StageFileBadNameError( "DVC-file name '{fname}' may not contain subdirectories" - " if '-c|--cwd' (deprecated) is specified. Use '-w|--wdir'" - " along with '-f' to specify DVC-file path with working" + " if `-c|--cwd` (deprecated) is specified. Use `-w|--wdir`" + " along with `-f` to specify DVC-file path with working" " directory.".format(fname=fname) ) wdir = cwd @@ -571,8 +571,8 @@ def _fill_stage_outputs(stage, **kwargs): def _check_dvc_filename(fname): if not Stage.is_valid_filename(fname): raise StageFileBadNameError( - "bad DVC-file name '{}'. DVC-files should be named" - " 'Dvcfile' or have a '.dvc' suffix (e.g. '{}.dvc').".format( + "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) ) ) @@ -736,7 +736,7 @@ def check_can_commit(self, force): if not force and not prompt.confirm(msg): raise StageCommitError( "unable to commit changed '{}'. Use `-f|--force` to " - "force.`".format(self.relpath) + "force.".format(self.relpath) ) self.save() diff --git a/dvc/utils/__init__.py b/dvc/utils/__init__.py index 538b7a97e1..b0cb6b3fff 100644 --- a/dvc/utils/__init__.py +++ b/dvc/utils/__init__.py @@ -232,7 +232,7 @@ def _to_chunks_by_chunks_number(list_to_split, num_chunks): def to_chunks(list_to_split, num_chunks=None, chunk_size=None): if (num_chunks and chunk_size) or (not num_chunks and not chunk_size): raise ValueError( - "One and only one of 'num_chunks', 'chunk_size' must be defined" + "Only one among `num_chunks` or `chunk_size` must be defined." ) if chunk_size: return _split(list_to_split, chunk_size) diff --git a/tests/unit/command/test_imp_url.py b/tests/unit/command/test_imp_url.py index 3ec0efbaac..50cb6e5bd5 100644 --- a/tests/unit/command/test_imp_url.py +++ b/tests/unit/command/test_imp_url.py @@ -29,7 +29,7 @@ def test_failed_import_url(mocker, caplog, dvc_repo): assert cmd.run() == 1 expected_error = ( "failed to import http://somesite.com/file_name. " - "You could also try downloading it manually and " - "adding it with `dvc add` command." + "You could also try downloading it manually, and " + "adding it with `dvc add`." ) assert expected_error in caplog.text