From 3038be068686a8832b93099550865e1e7ea03c02 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 17 Mar 2026 13:40:14 -0400 Subject: [PATCH] chore: add IDAA guardrail to migrate_fa_to_lucide.py (abort if run on src/routes/idaa) --- scripts/migrate_fa_to_lucide.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/migrate_fa_to_lucide.py b/scripts/migrate_fa_to_lucide.py index 6e127ac4..a944362d 100644 --- a/scripts/migrate_fa_to_lucide.py +++ b/scripts/migrate_fa_to_lucide.py @@ -189,14 +189,13 @@ def parse_fa_class(class_str): elif p.startswith('fa-'): if icon_name is None: icon_name = p # first real icon name wins - else: extra.append(p) return icon_name, extra, has_spin def replace_span(m): """Regex sub callback: replace a single FA span with a Lucide component.""" - icon_name, extra, has_spin = parse_fa_class(m.group(1)) + """ if icon_name is None: return m.group(0) @@ -292,6 +291,13 @@ def main(): print('Usage: migrate_fa_to_lucide.py ') sys.exit(1) + + # IDAA Guardrail: Abort if any target is src/routes/idaa or a subdirectory + for arg in sys.argv[1:]: + if Path(arg).resolve().as_posix().endswith('src/routes/idaa') or '/src/routes/idaa/' in Path(arg).resolve().as_posix(): + print('ABORT: This script must not be run against src/routes/idaa or its subdirectories. IDAA content is private and protected.') + sys.exit(1) + targets = [] for arg in sys.argv[1:]: p = Path(arg)