MCPcopy
hub / github.com/doocs/leetcode / run

Function run

run_format.py:384–409  ·  view source on GitHub ↗

Start formatting

()

Source from the content-addressed store, hash-verified

382
383
384def 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
412if __name__ == "__main__":

Callers 1

run_format.pyFile · 0.70

Calls 6

find_all_pathsFunction · 0.85
add_headerFunction · 0.85
remove_headerFunction · 0.85
format_inline_codeFunction · 0.85
format_rust_files_linuxFunction · 0.70

Tested by

no test coverage detected