MCPcopy Create free account
hub / github.com/ddnet/ddnet / find_clang_format

Function find_clang_format

scripts/fix_style.py:39–52  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

37
38
39def find_clang_format(version):
40 for binary in (
41 "clang-format",
42 f"clang-format-{version}",
43 f"/opt/clang-format-static/clang-format-{version}",
44 ):
45 try:
46 out = subprocess.check_output([binary, "--version"])
47 except FileNotFoundError:
48 continue
49 if f"clang-format version {version}." in out.decode("utf-8"):
50 return binary
51 print(f"Found no clang-format {version}")
52 sys.exit(-1)
53
54
55clang_format_bin = find_clang_format(20)

Callers 1

fix_style.pyFile · 0.85

Calls 1

exitMethod · 0.45

Tested by

no test coverage detected