Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when no match found. #4354

Merged
merged 4 commits into from
Aug 10, 2020
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
4 changes: 3 additions & 1 deletion dvc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def main(argv=None): # noqa: C901
ret = 255

try:
if ret != 0:
if ret != 0 and (
ret != 1 or getattr(args, "cmd", "") != "check-ignore"
):
logger.info(FOOTER)

if analytics.is_enabled():
Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_check_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_check_ignore(tmp_dir, dvc, file, ret, output, caplog):

assert main(["check-ignore", file]) == ret
assert (file in caplog.text) is output
assert "Having any troubles?" not in caplog.text


@pytest.mark.parametrize(
Expand Down Expand Up @@ -60,8 +61,9 @@ def test_check_ignore_non_matching(tmp_dir, dvc, non_matching, caplog):
[],
],
)
def test_check_ignore_error_args_cases(tmp_dir, dvc, args):
def test_check_ignore_error_args_cases(tmp_dir, dvc, args, caplog):
assert main(["check-ignore"] + args) == 255
assert ("Having any troubles?" in caplog.text) == ("-q" not in args)


@pytest.mark.parametrize("path,ret", [({"dir": {}}, 0), ({"dir": "files"}, 1)])
Expand Down