"""Quick syntax check for all modified/new Python files.""" import ast import sys files = [ 'auth.py', 'hub.py', 'config.py', 'gateway.py', 'main.py', 'bot.py', ] errors = [] for f in files: try: with open(f'../{f}', encoding='utf-8') as fh: ast.parse(fh.read()) print(f' OK: {f}') except SyntaxError as e: print(f' FAIL: {f} - {e}') errors.append(f) if errors: print(f'\nFailed: {errors}') sys.exit(1) else: print('\nAll files parse OK')