format/j1: re-format all files to catch any improvements made along the way

This commit is contained in:
Tyler Wilding
2024-05-24 01:45:27 -04:00
parent 59194f78a0
commit ba88a54902
161 changed files with 24466 additions and 23159 deletions
+20
View File
@@ -0,0 +1,20 @@
import glob
from pathlib import Path
import subprocess
import time
from colorama import just_fix_windows_console, Fore, Back, Style
just_fix_windows_console()
files = glob.glob("./goal_src/jak1/**/*.gc", recursive=True)
total_ms = 0
for file in files:
start_time = time.perf_counter()
subprocess.run(["./out/build/Release/bin/formatter", "--write", "--file", file])
elapsed_ms = (time.perf_counter() - start_time) * 1000
total_ms = total_ms + elapsed_ms
print(f"Formatted .../{Path(file).stem} in {Fore.CYAN} {elapsed_ms:.2f}ms {Fore.RESET}")
print(f"In total that took {total_ms}ms for {len(files)} files!")
subprocess.run(["git", "diff", "--shortstat", "origin/master"])