MCPcopy Index your code
hub / github.com/showlab/Code2Video / validate_code_syntax

Method validate_code_syntax

src/scope_refine.py:331–339  ·  view source on GitHub ↗

Validate code syntax correctness

(self, code: str)

Source from the content-addressed store, hash-verified

329 return context
330
331 def validate_code_syntax(self, code: str) -> Tuple[bool, Optional[str]]:
332 """Validate code syntax correctness"""
333 try:
334 compile(code, "<string>", "exec")
335 return True, None
336 except SyntaxError as e:
337 return False, f"Syntax Error: {e}"
338 except Exception as e:
339 return False, f"Compilation Error: {e}"
340
341 def dry_run_test(self, code: str, section_id: str, output_dir: Path) -> Tuple[bool, Optional[str]]:
342 """Execute dry run test (do not render video)"""

Callers 2

fix_code_smartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected