Clang-Format 14 (#1321)

* format

* Update dockerfile and other documentation

* Update mac instructions
This commit is contained in:
Derek Hensley
2023-07-27 09:15:40 -07:00
committed by GitHub
parent 9e85f5545a
commit eb6b837d65
11 changed files with 97 additions and 83 deletions
+15 -2
View File
@@ -14,8 +14,8 @@ from typing import List
# clang-format, clang-tidy and clang-apply-replacements default version
# Version 11 is used when available for more consistency between contributors
CLANG_VER = 11
# This specific version is used when available, for more consistency between contributors
CLANG_VER = 14
# Clang-Format options (see .clang-format for rules applied)
FORMAT_OPTS = "-i -style=file"
@@ -145,6 +145,12 @@ def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
def main():
parser = argparse.ArgumentParser(description="Format files in the codebase to enforce most style rules")
parser.add_argument("files", metavar="file", nargs="*")
parser.add_argument(
"--show-paths",
dest="show_paths",
action="store_true",
help="Print the paths to the clang-* binaries used",
)
parser.add_argument(
"-j",
dest="jobs",
@@ -155,6 +161,13 @@ def main():
)
args = parser.parse_args()
if args.show_paths:
import shutil
print("CLANG_FORMAT ->", shutil.which(CLANG_FORMAT))
print("CLANG_TIDY ->", shutil.which(CLANG_TIDY))
print("CLANG_APPLY_REPLACEMENTS ->", shutil.which(CLANG_APPLY_REPLACEMENTS))
nb_jobs = args.jobs or multiprocessing.cpu_count()
if nb_jobs > 1:
if CLANG_APPLY_REPLACEMENTS is None: