MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / run_clang_format

Function run_clang_format

scripts/sanitize-commit.py:93–107  ·  view source on GitHub ↗
(root: Path)

Source from the content-addressed store, hash-verified

91
92
93def run_clang_format(root: Path) -> None:
94 if shutil.which("clang-format") is None:
95 print("clang-format not on PATH -- skipping.")
96 return
97
98 files = [str(p) for p in iter_source_files(root)]
99 if not files:
100 return
101
102 batch = 200
103 for i in range(0, len(files), batch):
104 chunk = files[i : i + batch]
105 result = run(["clang-format", "-i", *chunk])
106 if result.returncode != 0:
107 print("clang-format failed on one of: " + ", ".join(chunk))
108
109
110def run_black(root: Path) -> None:

Callers 1

mainFunction · 0.85

Calls 2

runFunction · 0.85
iter_source_filesFunction · 0.70

Tested by

no test coverage detected