Files
passepartout/check_syntax.py
Amr Gharbeia 79a3f303cc
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
fix(skills): Comprehensive syntax and symbol repair for all skills
2026-04-19 15:47:59 -04:00

26 lines
770 B
Python

import re, glob
def check_file(fp):
with open(fp, 'r') as f:
content = f.read()
blocks = re.findall(r'#\+begin_src lisp\s+(.*?)\s+#\+end_src', content, re.DOTALL)
code = ' '.join(blocks)
# Very simple check for unbalanced backquotes/commas
# (Doesn't handle strings/comments perfectly but helps)
backquotes = code.count('`')
commas = code.count(',')
# Count character literals
bq_chars = code.count('#\\`')
comma_chars = code.count('#\\,')
real_commas = commas - comma_chars
real_backquotes = backquotes - bq_chars
if real_commas > 0 and real_backquotes == 0:
print(f"WARN: {fp} has {real_commas} commas but 0 backquotes.")
for fp in glob.glob('skills/*.org'):
check_file(fp)