Skip to content

Commit 249f6c5

Browse files
authored
Merge pull request #3027 from Suor/status-noop
ui: warn about ignored options for `dvc status` and a grammar fix
2 parents 11fa920 + bafac6d commit 249f6c5

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

dvc/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def __init__(self, dvc_file_name):
167167
class BadMetricError(DvcException):
168168
def __init__(self, paths):
169169
super().__init__(
170-
"the following metrics do not exists, "
170+
"the following metrics do not exist, "
171171
"are not metric files or are malformed: {paths}".format(
172172
paths=", ".join("'{}'".format(path) for path in paths)
173173
)

dvc/repo/status.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import logging
2+
from itertools import compress
23

34
from funcy.py3 import cat
45

6+
from dvc.exceptions import DvcException
57
from . import locked
68

79

@@ -113,4 +115,15 @@ def status(
113115
remote=remote,
114116
all_tags=all_tags,
115117
)
118+
119+
ignored = list(
120+
compress(
121+
["--all-branches", "--all-tags", "--jobs"],
122+
[all_branches, all_tags, jobs],
123+
)
124+
)
125+
if ignored:
126+
msg = "the following options are meaningless for local status: {}"
127+
raise DvcException(msg.format(", ".join(ignored)))
128+
116129
return _local_status(self, targets, with_deps=with_deps)

tests/func/test_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,6 @@ def test_show_multiple_outputs(tmp_dir, dvc, caplog):
868868
assert 1 == main(["metrics", "show", "1.json", "not-found"])
869869
assert '1.json: {"AUC": 1}' in caplog.text
870870
assert (
871-
"the following metrics do not exists, "
871+
"the following metrics do not exist, "
872872
"are not metric files or are malformed: 'not-found'"
873873
) in caplog.text

0 commit comments

Comments
 (0)