mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
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:
+3
-1
@@ -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():
|
||||
|
||||
@@ -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)])
|
||||
|
||||
Reference in New Issue
Block a user