Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrupp committed May 28, 2024
1 parent f0bc6eb commit 667fef9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions analyzer/codechecker_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 3 additions & 9 deletions analyzer/tests/functional/analyze/test_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,9 +1250,7 @@ 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)
self.assertEqual(out.count('hicpp-use-nullptr'), 2)

analyze_cmd = [self._codechecker_cmd, "check", "-l", build_json,
"--analyzers", "clangsa", "-o", self.report_dir,
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

0 comments on commit 667fef9

Please sign in to comment.