From 5d6605b05686385e5016071e7326982994f03a06 Mon Sep 17 00:00:00 2001 From: Daniel Krupp Date: Fri, 27 Oct 2023 10:22:35 +0200 Subject: [PATCH] Fixits from clang-tidy will be rendered as notes instead of events Fixit markups from clang-tidy should be rendered as independent note tags (in the HTML output and the WEB UI) than events with arrows as it is not part of the control flow. --- .../analyzers/clang_tidy/parser.py | 2 +- .../tidy_output_test_files/tidy3_cpp.plist | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/report-converter/codechecker_report_converter/analyzers/clang_tidy/parser.py b/tools/report-converter/codechecker_report_converter/analyzers/clang_tidy/parser.py index 5ab1a2de48..646712527a 100644 --- a/tools/report-converter/codechecker_report_converter/analyzers/clang_tidy/parser.py +++ b/tools/report-converter/codechecker_report_converter/analyzers/clang_tidy/parser.py @@ -159,7 +159,7 @@ def _parse_fixits( # a line number, and then a | character. col = line.find(message_text) - line.find("|") - 1 - report.bug_path_events.append(BugPathEvent( + report.notes.append(BugPathEvent( f"{message_text} (fixit)", report.file, report.line, diff --git a/tools/report-converter/tests/unit/analyzers/tidy_output_test_files/tidy3_cpp.plist b/tools/report-converter/tests/unit/analyzers/tidy_output_test_files/tidy3_cpp.plist index 7e443701da..8d1478c7ca 100644 --- a/tools/report-converter/tests/unit/analyzers/tidy_output_test_files/tidy3_cpp.plist +++ b/tools/report-converter/tests/unit/analyzers/tidy_output_test_files/tidy3_cpp.plist @@ -22,25 +22,24 @@ line 4 - path + notes - depth + location + + col + 12 + file 0 - kind - event - location - - col - 12 - file - 0 - line - 4 + line + 4 message nullptr (fixit) + + path + depth 0