From d78d3b599ce3a0daf08a3c2e0462e34d5337e6e7 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 19 Apr 2026 15:39:41 +0200 Subject: [PATCH] fix(content): argparse --dry-run for generate_corp_stubs.py; populate cross_refs (#828 nits) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - generate_corp_stubs.py: add argparse with --dry-run (prints planned stub creations without writing files) and --help - calloway-distillery.md: cross_refs → [thrds, mercado-travessia] - thrds.md: cross_refs → [calloway-distillery, mercado-travessia] - vins-de-grand-vide.md: cross_refs → [nordmark-skog] - thalassa-resort-group.md: cross_refs → [the-registry, prometheus-labs] Co-Authored-By: Claude Sonnet 4.6 --- tooling/generate_corp_stubs.py | 34 ++++++++++++++++++---- wiki/corporations/calloway-distillery.md | 2 +- wiki/corporations/thalassa-resort-group.md | 2 +- wiki/corporations/thrds.md | 2 +- wiki/corporations/vins-de-grand-vide.md | 2 +- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/tooling/generate_corp_stubs.py b/tooling/generate_corp_stubs.py index 150e97ce2..507d34226 100644 --- a/tooling/generate_corp_stubs.py +++ b/tooling/generate_corp_stubs.py @@ -1,6 +1,13 @@ #!/usr/bin/env python3 -"""Generate minimal wiki stub pages for corps in brands.toml that don't yet have wiki pages.""" +"""Generate minimal wiki stub pages for corps in brands.toml that don't yet have wiki pages. +Usage: + python3 tooling/generate_corp_stubs.py [--dry-run] + +In --dry-run mode, prints which stubs would be created without writing any files. +""" + +import argparse from pathlib import Path REPO = Path(__file__).parent.parent @@ -368,8 +375,20 @@ cross_refs: [] """ def main(): + parser = argparse.ArgumentParser( + description="Generate minimal wiki stub pages for corps in brands.toml." + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Print which stubs would be created without writing any files.", + ) + args = parser.parse_args() + corps = parse_brands_toml(BRANDS_TOML) print(f"Found {len(corps)} unique corp_ids in brands.toml") + if args.dry_run: + print("(dry-run — no files will be written)\n") created = 0 skipped = 0 @@ -378,12 +397,17 @@ def main(): if stub_path.exists(): skipped += 1 continue - content = generate_stub(slug, meta["origin_system"], meta["brand_category"]) - stub_path.write_text(content, encoding="utf-8") + if args.dry_run: + print(f" (dry-run) Would create: {slug}.md") + else: + content = generate_stub(slug, meta["origin_system"], meta["brand_category"]) + stub_path.write_text(content, encoding="utf-8") + print(f" created: {slug}.md") created += 1 - print(f" created: {slug}.md") - print(f"\nDone. Created {created} stubs, skipped {skipped} existing.") + action = "Would create" if args.dry_run else "Created" + print(f"\nDone. {action} {created} stubs, skipped {skipped} existing.") + if __name__ == "__main__": main() diff --git a/wiki/corporations/calloway-distillery.md b/wiki/corporations/calloway-distillery.md index 8ac5b1da7..0769512f8 100644 --- a/wiki/corporations/calloway-distillery.md +++ b/wiki/corporations/calloway-distillery.md @@ -11,7 +11,7 @@ faction_type: economic headquarters: Calloway Reach (GJ 3325) tags: [] decision_refs: [] -cross_refs: [] +cross_refs: [thrds, mercado-travessia] --- # Calloway Distillery diff --git a/wiki/corporations/thalassa-resort-group.md b/wiki/corporations/thalassa-resort-group.md index 7867cde4c..30e7fbd40 100644 --- a/wiki/corporations/thalassa-resort-group.md +++ b/wiki/corporations/thalassa-resort-group.md @@ -11,7 +11,7 @@ faction_type: economic headquarters: Gateway (GJ 244A) tags: [hospitality, fine_dining, entertainment, tractus, assembly, gateway] decision_refs: [D-175] -cross_refs: [] +cross_refs: [the-registry, prometheus-labs] --- # Thalassa Resort Group diff --git a/wiki/corporations/thrds.md b/wiki/corporations/thrds.md index 6262affc8..812260cbe 100644 --- a/wiki/corporations/thrds.md +++ b/wiki/corporations/thrds.md @@ -11,7 +11,7 @@ faction_type: economic headquarters: Braemar (GJ 475) tags: [] decision_refs: [] -cross_refs: [] +cross_refs: [calloway-distillery, mercado-travessia] --- # thrds diff --git a/wiki/corporations/vins-de-grand-vide.md b/wiki/corporations/vins-de-grand-vide.md index 67087dc74..bc5a87999 100644 --- a/wiki/corporations/vins-de-grand-vide.md +++ b/wiki/corporations/vins-de-grand-vide.md @@ -11,7 +11,7 @@ faction_type: economic headquarters: Confluent (GJ 395) tags: [] decision_refs: [] -cross_refs: [] +cross_refs: [nordmark-skog] --- # Vins de Grand Vide