diff --git a/dvc/main.py b/dvc/main.py index fc1450e536..07e0812537 100644 --- a/dvc/main.py +++ b/dvc/main.py @@ -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(): diff --git a/tests/func/test_check_ignore.py b/tests/func/test_check_ignore.py index eba86bc98f..905b6245d2 100644 --- a/tests/func/test_check_ignore.py +++ b/tests/func/test_check_ignore.py @@ -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)])