Let the caller state the project's version

--version replaces the commit hash on the cover and the project page, for
generate and from-folder alike. Without it the report still falls back to
repository_version from the metadata, else the scanned commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
alexanderandClaude Opus 5.5 committed 2026-09-25 12:22:45 +02:00
1 parent ffcd68f9f8
commit 0ace2e1803
4 files changed
+31 -10

No files matched your search

+3 -1
View File
@@ -53,6 +53,7 @@ def render(
*,
project: str | None = None,
manufacturer: str | None = None,
version: str | None = None,
) -> tuple[str, bytes]:
"""Render the report of one scan.
@@ -61,6 +62,7 @@ def render(
metrics: The metrics document, if one was built.
project: The project name the caller supplied; overrides the metadata's.
manufacturer: The manufacturer the caller supplied.
version: The version the caller supplied; overrides the commit the metadata names.
Returns:
The file name the report should be saved under, and its bytes.
@@ -83,7 +85,7 @@ def render(
logging_context.logger.info(f"Rendering the report from {', '.join(found)}...")
context = build_context(sources, documents, project=project, manufacturer=manufacturer)
context = build_context(sources, documents, project=project, manufacturer=manufacturer, version=version)
return NAME.format(scan=sources.scan_id), render_pdf(context)