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

Fix trim-path-prefix functionality in HTML export #4387

Merged
merged 1 commit into from
Nov 29, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Checker(TypedDict):

class HTMLReport(TypedDict):
fileId: str
path: str
reportHash: Optional[str]
checker: Checker
analyzerName: Optional[str]
Expand Down Expand Up @@ -239,6 +240,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 ''
Expand Down Expand Up @@ -309,7 +311,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'],
Expand Down Expand Up @@ -436,7 +438,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(
Expand Down