mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 15:28:27 +01:00
dvc: change ` for ' in dynamic parts of output messages (#2644)
* dvc: change ` for ' in dinamic parts of DVC outputs per https://github.com/iterative/dvc/pull/2644#issuecomment-545151398 * dvc: use ' for dynamic output and ` for DVC names per https://github.com/iterative/dvc/pull/2644#discussion_r338417698
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
5d6918a04c
commit
a48481b01f
@@ -24,7 +24,7 @@ class CmdDestroy(CmdBase):
|
||||
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()
|
||||
|
||||
@@ -19,7 +19,7 @@ class CmdImportUrl(CmdBase):
|
||||
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
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -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."
|
||||
),
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ class CmdRemove(CmdBase):
|
||||
|
||||
raise DvcException(
|
||||
"Cannot purge without a confirmation from the user."
|
||||
" Use '-f' to force."
|
||||
" Use `-f` to force."
|
||||
)
|
||||
|
||||
def run(self):
|
||||
|
||||
+3
-3
@@ -27,9 +27,9 @@ class CmdRun(CmdBase):
|
||||
]
|
||||
): # 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
|
||||
|
||||
|
||||
+3
-3
@@ -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 @@ class OverlappingOutputPathsError(DvcException):
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ this.message = (
|
||||
"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
|
||||
)
|
||||
)
|
||||
|
||||
+2
-2
@@ -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)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -200,10 +200,10 @@ class Git(Base):
|
||||
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)
|
||||
|
||||
+6
-6
@@ -242,7 +242,7 @@ class Stage(object):
|
||||
|
||||
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 @@ class Stage(object):
|
||||
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 @@ class Stage(object):
|
||||
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 @@ class Stage(object):
|
||||
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()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user