From c5747f3dd33feef9405c167770261996f84eca43 Mon Sep 17 00:00:00 2001 From: Daniel Krupp Date: Tue, 26 Nov 2024 18:15:42 +0100 Subject: [PATCH] Fix trim-path-prefix functionality in HTML export --- .../codechecker_report_converter/report/output/html/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/report-converter/codechecker_report_converter/report/output/html/html.py b/tools/report-converter/codechecker_report_converter/report/output/html/html.py index c102199cfd..5c05cb49f5 100644 --- a/tools/report-converter/codechecker_report_converter/report/output/html/html.py +++ b/tools/report-converter/codechecker_report_converter/report/output/html/html.py @@ -239,6 +239,7 @@ def to_macro_expansions( html_reports.append({ 'fileId': report.file.id, 'reportHash': report.report_hash, + 'path': report.file.path, 'checker': { 'name': report.checker_name, 'url': self._get_doc_url(report) or '' @@ -309,7 +310,7 @@ def create_index_html(self, output_dir: str): table_reports = map(lambda data: { 'link': os.path.basename(data['link']), - 'file-path': data['report']['fileId'], + 'file-path': data['report']['path'], 'report-hash': data['report']['reportHash'], 'checker-name': data['report']['checker']['name'], 'checker-url': data['report']['checker']['url'], @@ -436,7 +437,6 @@ def convert( if not reports: LOG.info('No report data in %s file.', file_path) return set() - html_filename = f"{os.path.basename(file_path)}.html" html_output_path = os.path.join(output_dir_path, html_filename) _, changed_files = html_builder.create(