Skip to content

Commit 83f0792

Browse files
committed
Fix trim-path-prefix functionality in HTML export
1 parent b0555b9 commit 83f0792

File tree

1 file changed

+3
-2
lines changed
  • tools/report-converter/codechecker_report_converter/report/output/html

1 file changed

+3
-2
lines changed

tools/report-converter/codechecker_report_converter/report/output/html/html.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Checker(TypedDict):
6363

6464
class HTMLReport(TypedDict):
6565
fileId: str
66+
path: str
6667
reportHash: Optional[str]
6768
checker: Checker
6869
analyzerName: Optional[str]
@@ -239,6 +240,7 @@ def to_macro_expansions(
239240
html_reports.append({
240241
'fileId': report.file.id,
241242
'reportHash': report.report_hash,
243+
'path': report.file.path,
242244
'checker': {
243245
'name': report.checker_name,
244246
'url': self._get_doc_url(report) or ''
@@ -309,7 +311,7 @@ def create_index_html(self, output_dir: str):
309311

310312
table_reports = map(lambda data: {
311313
'link': os.path.basename(data['link']),
312-
'file-path': data['report']['fileId'],
314+
'file-path': data['report']['path'],
313315
'report-hash': data['report']['reportHash'],
314316
'checker-name': data['report']['checker']['name'],
315317
'checker-url': data['report']['checker']['url'],
@@ -436,7 +438,6 @@ def convert(
436438
if not reports:
437439
LOG.info('No report data in %s file.', file_path)
438440
return set()
439-
440441
html_filename = f"{os.path.basename(file_path)}.html"
441442
html_output_path = os.path.join(output_dir_path, html_filename)
442443
_, changed_files = html_builder.create(

0 commit comments

Comments
 (0)