Skip to content

Commit 05baa8e

Browse files
committed
feat: add rust formatting before compilation
1 parent 77b950b commit 05baa8e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

rustsmith_validator/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def compile_and_run(file_path: Path, flag: str, progress: ProgressBar[V], direct
1414
output_path = file_path.parent / f"O{flag}"
1515
shutil.rmtree(output_path, ignore_errors=True)
1616
os.mkdir(output_path)
17+
fmt_command = f"rustfmt {file_path}"
18+
subprocess.run(fmt_command.split(" "), stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
1719
command = f"rustc -C opt-level={flag} {file_path} -o {output_path / 'out'}"
1820
result = subprocess.run(command.split(" "), stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
1921
with open(output_path / "compile.log", "w") as file:

0 commit comments

Comments
 (0)