(root: Path)
| 91 | |
| 92 | |
| 93 | def 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 | |
| 110 | def run_black(root: Path) -> None: |
no test coverage detected