From a81759387473b3e31835e3087fbb5d33bdf759fd Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 18 May 2025 17:47:04 -0400 Subject: [PATCH] Don't log same snippets (per system) twice Signed-off-by: Ihar Hrachyshka --- nixpkgs_review/report.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixpkgs_review/report.py b/nixpkgs_review/report.py index f6ab53ad..6e72e185 100644 --- a/nixpkgs_review/report.py +++ b/nixpkgs_review/report.py @@ -88,6 +88,7 @@ def remove_ansi_escape_sequences(text: str) -> str: def html_logs_section(logs_dir: Path, packages: list[Attr], system: str) -> str: res = "" + seen_tails = set() for pkg in packages: tail = remove_ansi_escape_sequences( get_file_tail(logs_dir / get_log_filename(pkg, system)) @@ -96,7 +97,10 @@ def html_logs_section(logs_dir: Path, packages: list[Attr], system: str) -> str: if not res: res = "\n---\n" res += f"
\nError logs: `{system}`\n" + if tail in seen_tails: + continue res += f"
\n{pkg.name}\n
{tail}
\n
\n" + seen_tails.add(tail) res += "
\n" return res