Răsfoiți Sursa

Limit default search path of build-scripts/check_stdlib_usage.py

Anonymous Maarten 2 săptămâni în urmă
părinte
comite
dd6f438efb
1 a modificat fișierele cu 8 adăugiri și 6 ștergeri
  1. 8 6
      build-scripts/check_stdlib_usage.py

+ 8 - 6
build-scripts/check_stdlib_usage.py

@@ -255,15 +255,17 @@ def find_symbols_in_dir(path: pathlib.Path) -> int:
 
 def main():
     parser = argparse.ArgumentParser(fromfile_prefix_chars="@")
-    parser.add_argument("path", default=SDL_ROOT, nargs="?", type=pathlib.Path, help="Path to look for stdlib symbols")
+    parser.add_argument("paths", default=[SDL_ROOT / "src", SDL_ROOT / "test"], nargs="*", type=pathlib.Path, help="Paths to look for stdlib symbols")
     args = parser.parse_args()
 
-    print(f"Looking for stdlib usage in {args.path}...")
+    print(f"Looking for stdlib usage in {', '.join(str(p) for p in args.paths)}...")
 
-    if args.path.is_file():
-        match_count = find_symbols_in_file(args.path)
-    else:
-        match_count = find_symbols_in_dir(args.path)
+    match_count = 0
+    for path in args.paths:
+        if path.is_file():
+            match_count = find_symbols_in_file(path)
+        else:
+            match_count = find_symbols_in_dir(path)
 
     if match_count:
         print("If the stdlib usage is intentional, add a '// This should NOT be SDL_<symbol>()' line comment.")