From da82d94a12dd44f4d3f6400e01f1674c3de93668 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 16 Jun 2017 08:13:18 -0700 Subject: [PATCH] [report] restore "no issues found" output Summary: We lost it at some point... Reviewed By: dulmarod Differential Revision: D5264303 fbshipit-source-id: 71cd3b0 --- infer/lib/python/inferlib/issues.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/infer/lib/python/inferlib/issues.py b/infer/lib/python/inferlib/issues.py index 7c49f7e96..508c8681c 100644 --- a/infer/lib/python/inferlib/issues.py +++ b/infer/lib/python/inferlib/issues.py @@ -94,12 +94,14 @@ def _text_of_report_list(project_root, reports, bugs_txt_path, limit=None, formatter=colorize.TERMINAL_FORMATTER): n_issues = len(reports) if n_issues == 0: + msg = 'No issues found' if formatter == colorize.TERMINAL_FORMATTER: - out = colorize.color(' No issues found ', + msg = colorize.color(' %s ' % msg, colorize.SUCCESS, formatter) - return out + '\n' - else: - return 'No issues found' + if console_out: + utils.stderr(msg) + return msg + text_errors_list = [] for report in reports[:limit]: @@ -174,7 +176,6 @@ def _text_of_report_list(project_root, reports, bugs_txt_path, limit=None, ) if console_out: - utils.stderr('') utils.stderr(bug_list) utils.stdout(summary) @@ -194,6 +195,7 @@ def print_and_save_errors(infer_out, project_root, json_report, bugs_out, pmd_xml): errors = utils.load_json_from_path(json_report) errors = [e for e in errors if _is_user_visible(project_root, e)] + utils.stderr('') _text_of_report_list(project_root, errors, bugs_out, console_out=True, limit=10) plain_out = _text_of_report_list(project_root, errors, bugs_out,