From 3d13102f300ccf754db9e5cda2a6568741afbd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Sun, 1 Sep 2024 22:17:05 +0200 Subject: [PATCH] build: fixed default mutable arg in build_changelog.py --- scripts/build_changelog.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/build_changelog.py b/scripts/build_changelog.py index 54757099..1e7a15b7 100755 --- a/scripts/build_changelog.py +++ b/scripts/build_changelog.py @@ -12,6 +12,7 @@ - Reorder modules in a logical order (aw-webui, aw-server, aw-server-rust, aw-watcher-window, aw-watcher-afk, ...) - Remove duplicate aw-webui entries """ + import argparse import logging import os @@ -233,7 +234,11 @@ def summary_repo( else: hidden += 1 - for name, entries in (("✨ Features", feats), ("🐛 Fixes", fixes), ("🔨 Misc", misc)): + for name, entries in ( + ("✨ Features", feats), + ("🐛 Fixes", fixes), + ("🔨 Misc", misc), + ): if entries: _count = len(entries.strip().split("\n")) title = f"{name} ({_count})" @@ -295,7 +300,7 @@ def summary_repo( del subrepos[name] # add remaining repos - for name, output in subrepos.items(): + for output in subrepos.values(): out += "\n" out += output @@ -344,11 +349,14 @@ def build( commit_range: Tuple[str, str], output_path: str, repo_order: List[str], - filter_types=["build", "ci", "tests", "test"], + filter_types: List[str] | None = None, ): # provides a commit summary for the repo and subrepos, recursively looking up subrepos # NOTE: this must be done *before* `get_all_contributors` is called, # as the latter relies on summary_repo looking up all users and storing in a global. + if not filter_types: + filter_types = ["build", "ci", "tests", "test"] + logger.info("Generating commit summary") since, tag = commit_range output_changelog = summary_repo(