From f12ba5632b0ea9a673304a08c8f2bbdf21980b1b Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 05:18:11 +0100 Subject: [PATCH] fix: run retired_files through run_cli The new script's entry point skipped run_cli and its options were in no tools.md row, which two suite checks hold every tracked script to. --- scripts/retired_files.py | 10 ++++------ wiki/tools.md | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/retired_files.py b/scripts/retired_files.py index 401217572..7a2d3642d 100644 --- a/scripts/retired_files.py +++ b/scripts/retired_files.py @@ -24,6 +24,9 @@ import subprocess import sys from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent)) +from common import run_cli, write_if_changed # noqa: E402 + REPO_ROOT = Path(__file__).resolve().parents[1] RETIRED_FILE = REPO_ROOT / "retired.json" # The commit that published content addresses: 0d586ef6b, 2026-10-19. @@ -95,8 +98,6 @@ def dump(records: dict[str, dict]) -> str: def update(path: Path, old: dict, new: dict, day: str) -> int: """Records what *new* dropped from *old*. Returns how many left now.""" - from common import write_if_changed # noqa: PLC0415 - left = retired_between(old, new, day) record = load(path) merged = merge(record, left, new) @@ -136,9 +137,6 @@ def main() -> int: if not args.backfill: parser.print_help() return 2 - sys.path.insert(0, str(Path(__file__).parent)) - from common import write_if_changed # noqa: PLC0415 - records = backfill() current = json.loads((REPO_ROOT / "database.json").read_text(encoding="utf-8")) records = merge(records, {}, current) @@ -148,4 +146,4 @@ def main() -> int: if __name__ == "__main__": - sys.exit(main()) + run_cli(main) diff --git a/wiki/tools.md b/wiki/tools.md index b40e67136..36d5d10d6 100644 --- a/wiki/tools.md +++ b/wiki/tools.md @@ -1328,6 +1328,7 @@ before a release (wiki/release-process.md). Its lines stay in | Script | Purpose | |--------|---------| | `common.py` | Shared library: hash computation, file resolution, platform config loading, emulator profiles, target filtering | +| `retired_files.py` | The record of files that left the collection, `retired.json`, which `generate_db.py` appends to and the site's lookup reads. `--backfill` rebuilds it from the history of `database.json` since content addresses were published (`--output` names another file) | | `dedup.py` | Deduplicate `bios/` (`--dry-run`, `--bios-dir`): byte-identical copies are deleted and one kept. Identical MAME sets under other names stay one file, named in `_mame_clones.json`. Trees addressed by path are left alone (`NODEDUP_DIRS`), under a folder of that name at any depth: BBK, Bungie, C-Dogs SDL, Ikemen GO, mame, PinMAME, RPG Maker, ScummVM, Softdisk, TheXTech, splitwolf, Theme Hospital, c64-emu, opentyrian, tzdata | | `identity.py` | One content filed under two identities: groups `bios/` by content and reports a group that crosses manufacturers outside `KNOWN_SHARED` (`--strict` exits 1, pipeline step 3a) | | `slots.py` | Destinations the platform and a core both claim, and how the pack settles each (`--platform`, `--include-archived`, `--target`, `--json`, `--strict`, and pipeline step 3b passes the run's own `--include-archived` and `--target`) |