Error message when no match found. (#4354)

* Error message when no match found.

1. remove error message when no match found.

* Test update.

1.Test update cover return 0 and 1

* Remove unused arguments

* Error message show in dvc check-ignore
This commit is contained in:
karajan1001
2020-08-10 15:00:11 +03:00
committed by GitHub
parent 172032d3b3
commit 07dcf6953c
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -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():
+3 -1
View File
@@ -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(
@@ -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)])