Skip to content

Commit dd68e9a

Browse files
authored
Merge pull request #2986 from jorgeorpinel/output/format/single-quotes
dvc: use ' to mark dynamic command output, et al.
2 parents e031366 + 654525c commit dd68e9a

File tree

11 files changed

+28
-24
lines changed

11 files changed

+28
-24
lines changed

dvc/analytics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,6 @@ def _find_or_create_user_id():
164164
return user_id
165165

166166
except LockError:
167-
logger.debug("Failed to acquire {lockfile}".format(lockfile=lockfile))
167+
logger.debug(
168+
"Failed to acquire '{lockfile}'".format(lockfile=lockfile)
169+
)

dvc/command/remove.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _is_outs_only(self, target):
2020
if self.args.force:
2121
return False
2222

23-
msg = "Are you sure you want to remove {} with its outputs?".format(
23+
msg = "Are you sure you want to remove '{}' with its outputs?".format(
2424
target
2525
)
2626

@@ -38,7 +38,7 @@ def run(self):
3838
outs_only = self._is_outs_only(target)
3939
self.repo.remove(target, outs_only=outs_only)
4040
except DvcException:
41-
logger.exception("failed to remove {}".format(target))
41+
logger.exception("failed to remove '{}'".format(target))
4242
return 1
4343
return 0
4444

dvc/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def Choices(*choices):
8181
*choices: pass allowed values as arguments, or pass a list or
8282
tuple as a single argument
8383
"""
84-
return Any(*choices, msg="expected one of {}".format(",".join(choices)))
84+
return Any(*choices, msg="expected one of {}".format(", ".join(choices)))
8585

8686

8787
class Config(object): # pylint: disable=too-many-instance-attributes

dvc/remote/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, remote, cmd, ret, err):
5858

5959
class RemoteActionNotImplemented(DvcException):
6060
def __init__(self, action, scheme):
61-
m = "{} is not supported by {} remote".format(action, scheme)
61+
m = "{} is not supported for {} remotes".format(action, scheme)
6262
super(RemoteActionNotImplemented, self).__init__(m)
6363

6464

dvc/remote/oss.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ def __init__(self, repo, config):
6969
def oss_service(self):
7070
import oss2
7171

72-
logger.debug("URL {}".format(self.path_info))
73-
logger.debug("key id {}".format(self.key_id))
74-
logger.debug("key secret {}".format(self.key_secret))
72+
logger.debug("URL: {}".format(self.path_info))
73+
logger.debug("key id: {}".format(self.key_id))
74+
logger.debug("key secret: {}".format(self.key_secret))
7575

7676
auth = oss2.Auth(self.key_id, self.key_secret)
7777
bucket = oss2.Bucket(auth, self.endpoint, self.path_info.bucket)

dvc/repo/add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def add(repo, targets, recursive=False, no_commit=False, fname=None):
3737
"You are adding a large directory '{target}' recursively,"
3838
" consider tracking it as a whole instead.\n"
3939
"{purple}HINT:{nc} Remove the generated DVC-file and then"
40-
" run {cyan}dvc add {target}{nc}".format(
40+
" run `{cyan}dvc add {target}{nc}`".format(
4141
purple=colorama.Fore.MAGENTA,
4242
cyan=colorama.Fore.CYAN,
4343
nc=colorama.Style.RESET_ALL,

dvc/repo/gc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def _do_gc(typ, func, clist):
1313
removed = func(clist)
1414
if not removed:
15-
logger.info("No unused {} cache to remove.".format(typ))
15+
logger.info("No unused '{}' cache to remove.".format(typ))
1616

1717

1818
@locked

dvc/stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, deps):
116116
else:
117117
dep = "dependency"
118118

119-
msg = "missing {}: {}".format(dep, ", ".join(map(str, deps)))
119+
msg = "missing '{}': {}".format(dep, ", ".join(map(str, deps)))
120120
super(MissingDep, self).__init__(msg)
121121

122122

@@ -128,7 +128,7 @@ def __init__(self, missing_files):
128128
if len(missing_files) > 1:
129129
source += "s"
130130

131-
msg = "missing data {}: {}".format(source, ", ".join(missing_files))
131+
msg = "missing data '{}': {}".format(source, ", ".join(missing_files))
132132
super(MissingDataSource, self).__init__(msg)
133133

134134

dvc/updater.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,25 @@ def _notify(self):
124124

125125
def _get_update_instructions(self):
126126
instructions = {
127-
"pip": "Run {yellow}pip{reset} install dvc {blue}--upgrade{reset}",
128-
"rpm": "Run {yellow}yum{reset} update dvc",
129-
"brew": "Run {yellow}brew{reset} upgrade dvc",
127+
"pip": "Run `{yellow}pip{reset} install dvc "
128+
"{blue}--upgrade{reset}`",
129+
"rpm": "Run `{yellow}yum{reset} update dvc`",
130+
"brew": "Run `{yellow}brew{reset} upgrade dvc`",
130131
"deb": (
131-
"Run {yellow}apt-get{reset} install"
132-
" {blue}--only-upgrade{reset} dvc"
132+
"Run `{yellow}apt-get{reset} install"
133+
" {blue}--only-upgrade{reset} dvc`"
133134
),
134135
"binary": (
135136
"To upgrade follow these steps:\n"
136137
"1. Uninstall dvc binary\n"
137138
"2. Go to {blue}https://dvc.org{reset}\n"
138139
"3. Download and install new binary"
139140
),
140-
"conda": "Run {yellow}conda{reset} update dvc",
141-
"choco": "Run {yellow}choco{reset} upgrade dvc",
141+
"conda": "Run `{yellow}conda{reset} update dvc`",
142+
"choco": "Run `{yellow}choco{reset} upgrade dvc`",
142143
None: (
143-
"Find the latest release at\n{blue}"
144-
"https://github.com/iterative/dvc/releases/latest"
145-
"{reset}"
144+
"Find the latest release at\n"
145+
"{blue}https://github.com/iterative/dvc/releases/latest{reset}"
146146
),
147147
}
148148

dvc/utils/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def file_md5(fname):
5050
no_progress_bar = True
5151
if size >= LARGE_FILE_SIZE:
5252
no_progress_bar = False
53-
msg = "Computing md5 for a large file {}. This is only done once."
53+
msg = (
54+
"Computing md5 for a large file '{}'. This is only done once."
55+
)
5456
logger.info(msg.format(relpath(fname)))
5557
name = relpath(fname)
5658

tests/func/test_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_warn_about_large_directories(self):
9292
"You are adding a large directory 'large-dir' recursively,"
9393
" consider tracking it as a whole instead.\n"
9494
"{purple}HINT:{nc} Remove the generated DVC-file and then"
95-
" run {cyan}dvc add large-dir{nc}".format(
95+
" run `{cyan}dvc add large-dir{nc}`".format(
9696
purple=colorama.Fore.MAGENTA,
9797
cyan=colorama.Fore.CYAN,
9898
nc=colorama.Style.RESET_ALL,

0 commit comments

Comments
 (0)