Skip to content

Commit

Permalink
Merge pull request #3027 from Suor/status-noop
Browse files Browse the repository at this point in the history
ui: warn about ignored options for `dvc status` and a grammar fix
  • Loading branch information
efiop authored Jan 7, 2020
2 parents 11fa920 + bafac6d commit 249f6c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def __init__(self, dvc_file_name):
class BadMetricError(DvcException):
def __init__(self, paths):
super().__init__(
"the following metrics do not exists, "
"the following metrics do not exist, "
"are not metric files or are malformed: {paths}".format(
paths=", ".join("'{}'".format(path) for path in paths)
)
Expand Down
13 changes: 13 additions & 0 deletions dvc/repo/status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import logging
from itertools import compress

from funcy.py3 import cat

from dvc.exceptions import DvcException
from . import locked


Expand Down Expand Up @@ -113,4 +115,15 @@ def status(
remote=remote,
all_tags=all_tags,
)

ignored = list(
compress(
["--all-branches", "--all-tags", "--jobs"],
[all_branches, all_tags, jobs],
)
)
if ignored:
msg = "the following options are meaningless for local status: {}"
raise DvcException(msg.format(", ".join(ignored)))

return _local_status(self, targets, with_deps=with_deps)
2 changes: 1 addition & 1 deletion tests/func/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,6 @@ def test_show_multiple_outputs(tmp_dir, dvc, caplog):
assert 1 == main(["metrics", "show", "1.json", "not-found"])
assert '1.json: {"AUC": 1}' in caplog.text
assert (
"the following metrics do not exists, "
"the following metrics do not exist, "
"are not metric files or are malformed: 'not-found'"
) in caplog.text

0 comments on commit 249f6c5

Please sign in to comment.