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

This commit is contained in:
Anonymous Maarten
2026-06-18 20:23:13 +02:00
committed by Anonymous Maarten
parent 774728b6ff
commit dd6f438efb

View File

@@ -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.")