mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-21 22:18:13 +02:00
refactor(agent): vérification JS via _verify_written (déjà auto après écriture)
L'auto-check séparé dans la boucle agent doublonnait _verify_written et signalait à tort les fichiers écrits par morceaux (mode append). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c92e4d4a13
commit
d19624b46b
2 files changed
+9
-30
No files matched your search
@@ -103,6 +103,15 @@ def _verify_written(target: str) -> str | None:
|
||||
problems = check_html(target)
|
||||
if problems:
|
||||
return " ; ".join(problems)
|
||||
elif ext in (".js", ".mjs"):
|
||||
node = shutil.which("node")
|
||||
if node:
|
||||
proc = subprocess.run(
|
||||
[node, "--check", target], capture_output=True, text=True,
|
||||
timeout=15,
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
return (proc.stderr or proc.stdout)[:300]
|
||||
except SyntaxError as exc:
|
||||
return f"SyntaxError ligne {exc.lineno}: {exc.msg}"
|
||||
except ValueError as exc:
|
||||
|
||||
Reference in new issue
Block a user