Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[analyze] Removing long enabled checker list at info log level #4103

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions analyzer/codechecker_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +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 checkers:\n%s", '\n'.join(
k + ': ' + ', '.join(v) for k, v in enabled_checkers.items()))
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 + ': ' + ',\n '.join(v) for k, v in enabled_checkers.items()))

if 'makefile' in args and args.makefile:
statistics_data = __get_statistics_data(args)
Expand Down
10 changes: 2 additions & 8 deletions analyzer/tests/functional/analyze/test_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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. """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
Loading