From f0bc6ebef83604f7e0221ac093f3a12b713065ad Mon Sep 17 00:00:00 2001 From: Daniel Krupp Date: Mon, 27 Nov 2023 19:39:22 +0100 Subject: [PATCH 1/2] Removing long enabled checker list at info log level --- analyzer/codechecker_analyzer/analyzer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/analyzer/codechecker_analyzer/analyzer.py b/analyzer/codechecker_analyzer/analyzer.py index 076db745b6..9504789d8f 100644 --- a/analyzer/codechecker_analyzer/analyzer.py +++ b/analyzer/codechecker_analyzer/analyzer.py @@ -256,8 +256,9 @@ def perform_analysis(args, skip_handlers, rs_handler: ReviewStatusHandler, metadata_info['analyzer_statistics']['version'] = version metadata_tool['analyzers'][analyzer] = metadata_info - - LOG.info("Enabled checkers:\n%s", '\n'.join( + LOG.info("Enabled checker list can be found in " + + os.path.join(args.output_path, "metadata.json")) + LOG.debug("Enabled checkers:\n%s", '\n'.join( k + ': ' + ', '.join(v) for k, v in enabled_checkers.items())) if 'makefile' in args and args.makefile: From c0c23b8894889c31179f727c6fb8c013abd9815f Mon Sep 17 00:00:00 2001 From: Daniel Krupp Date: Mon, 27 May 2024 15:27:37 +0200 Subject: [PATCH 2/2] Review fixes --- analyzer/codechecker_analyzer/analyzer.py | 4 ++-- analyzer/tests/functional/analyze/test_analyze.py | 10 ++-------- .../analyze_and_parse/test_analyze_and_parse.py | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/analyzer/codechecker_analyzer/analyzer.py b/analyzer/codechecker_analyzer/analyzer.py index 9504789d8f..55f51f80ce 100644 --- a/analyzer/codechecker_analyzer/analyzer.py +++ b/analyzer/codechecker_analyzer/analyzer.py @@ -256,10 +256,10 @@ def perform_analysis(args, skip_handlers, rs_handler: ReviewStatusHandler, metadata_info['analyzer_statistics']['version'] = version metadata_tool['analyzers'][analyzer] = metadata_info - LOG.info("Enabled checker list can be found in " + + LOG.info("Enabled checker list can be found in %s", os.path.join(args.output_path, "metadata.json")) LOG.debug("Enabled checkers:\n%s", '\n'.join( - k + ': ' + ', '.join(v) for k, v in enabled_checkers.items())) + k + ': ' + ',\n '.join(v) for k, v in enabled_checkers.items())) if 'makefile' in args and args.makefile: statistics_data = __get_statistics_data(args) diff --git a/analyzer/tests/functional/analyze/test_analyze.py b/analyzer/tests/functional/analyze/test_analyze.py index 54205a6710..1f197aaab4 100644 --- a/analyzer/tests/functional/analyze/test_analyze.py +++ b/analyzer/tests/functional/analyze/test_analyze.py @@ -1250,8 +1250,6 @@ def test_analyzer_and_checker_config(self): errors="ignore") out, _ = process.communicate() - # It's printed as the member of enabled checkers at the beginning - # of the output, a found report and in the checker statistics. self.assertEqual(out.count('hicpp-use-nullptr'), 3) analyze_cmd = [self._codechecker_cmd, "check", "-l", build_json, @@ -1270,9 +1268,7 @@ def test_analyzer_and_checker_config(self): errors="ignore") out, _ = process.communicate() print(out) - # It's printed as the member of enabled checkers at the beginning - # of the output, a found report and in the checker statistics. - self.assertEqual(out.count('UninitializedObject'), 3) + self.assertEqual(out.count('UninitializedObject'), 2) analyze_cmd = [self._codechecker_cmd, "check", "-l", build_json, "--analyzers", "clangsa", "-o", self.report_dir, @@ -1293,9 +1289,7 @@ def test_analyzer_and_checker_config(self): out, _ = process.communicate() print(out) - # It is printed as the member of enabled checkers, but it gives no - # report. - self.assertEqual(out.count('UninitializedObject'), 1) + self.assertEqual(out.count('UninitializedObject'), 0) def test_invalid_compilation_database(self): """ Warn in case of an invalid enabled checker. """ diff --git a/analyzer/tests/functional/analyze_and_parse/test_analyze_and_parse.py b/analyzer/tests/functional/analyze_and_parse/test_analyze_and_parse.py index 46cf8d2a0e..e677c6e3b5 100644 --- a/analyzer/tests/functional/analyze_and_parse/test_analyze_and_parse.py +++ b/analyzer/tests/functional/analyze_and_parse/test_analyze_and_parse.py @@ -220,7 +220,7 @@ def check_one_file(self, path, mode): "[] - Skipping input file", # Enabled checkers are listed in the beginning of # analysis. - "[] - Enabled checkers:", + "[] - Enabled checker", "clang-tidy:", "clangsa:", "cppcheck:",