mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
* Pre-commit in CI * Specify python version, and install dos2unix for remod * Refactor remod hook to correctly install dependencies * Run pre-commit
25 lines
543 B
Python
25 lines
543 B
Python
import os
|
|
import pathlib
|
|
from pathlib import Path
|
|
import subprocess
|
|
|
|
all_files = []
|
|
for p in sorted(Path("./").rglob("*")):
|
|
if p.suffix in [".hpp", ".cpp"]:
|
|
all_files.append(pathlib.PurePath(p))
|
|
|
|
|
|
# formatting
|
|
for x in all_files:
|
|
subprocess.Popen(
|
|
f"python -m dos2unix {str(x)} {str(x)}",
|
|
shell=True,
|
|
stdout=open(os.devnull, "wb"),
|
|
)
|
|
cmd = f"clang-format -style=file -i {str(x)}"
|
|
# for xp in x.parents:
|
|
# print(get_file_base(x))
|
|
subprocess.Popen(cmd, shell=True)
|
|
|
|
# print(all_files)
|