Start formatting
()
| 382 | |
| 383 | |
| 384 | def run(): |
| 385 | """Start formatting""" |
| 386 | paths = find_all_paths() |
| 387 | |
| 388 | for path in paths: |
| 389 | add_header(path) |
| 390 | if any(path.endswith(suf) for suf in ["c", "cpp", "java"]): |
| 391 | # format with clang-format |
| 392 | os.system(f'npx clang-format -i --style=file "{path}"') |
| 393 | |
| 394 | # format with prettier |
| 395 | os.system('npx prettier --write "**/*.{js,ts,php,sql,md}"') |
| 396 | |
| 397 | # format with gofmt |
| 398 | os.system("gofmt -w .") |
| 399 | |
| 400 | # format with rustfmt |
| 401 | if platform.system() == "Linux": |
| 402 | format_rust_files_linux() |
| 403 | else: |
| 404 | format_rust_files_windows() |
| 405 | |
| 406 | for path in paths: |
| 407 | remove_header(path) |
| 408 | for path in paths: |
| 409 | format_inline_code(path) |
| 410 | |
| 411 | |
| 412 | if __name__ == "__main__": |
no test coverage detected