diff --git a/tools/check_powershell.py b/tools/check_powershell.py index dde421d..027d17e 100644 --- a/tools/check_powershell.py +++ b/tools/check_powershell.py @@ -9,7 +9,7 @@ import re import sys ROOT = pathlib.Path(__file__).resolve().parents[1] -POWERSHELL = sorted((*ROOT.glob("*.ps1"), *ROOT.glob("src/*.ps1"), *ROOT.glob("src/*.psm1"))) +POWERSHELL = sorted((*ROOT.rglob("*.ps1"), *ROOT.rglob("*.psm1"))) def check_balanced(path: pathlib.Path) -> list[str]: @@ -71,7 +71,7 @@ def main() -> int: for path in POWERSHELL: errors.extend(check_balanced(path)) source = path.read_text(encoding="utf-8-sig") - if path.name != "bootstrap.ps1" and "Set-StrictMode" not in source: + if path.parent.name in {"src", "tools"} and "Set-StrictMode" not in source: errors.append(f"{path.relative_to(ROOT)}: missing Set-StrictMode") for relative in ("schemas/profile.schema.json", "schemas/machine.schema.json"):