mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-23 16:45:12 -04:00
Clang-Format 14 (#1321)
* format * Update dockerfile and other documentation * Update mac instructions
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user