Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dvc/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/imp_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
),
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions dvc/command/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)


Expand Down Expand Up @@ -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."
)


Expand Down Expand Up @@ -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
)


Expand Down
2 changes: 1 addition & 1 deletion dvc/remote/slow_link_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand Down
4 changes: 2 additions & 2 deletions dvc/repo/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ 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
)
)

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)
)
)
Expand Down
8 changes: 4 additions & 4 deletions dvc/scm/git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions dvc/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
)
)
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion dvc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/command/test_imp_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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