build: update clang-format script (#34286)

This commit is contained in:
Shelley Vohr
2022-06-08 21:26:41 +02:00
committed by GitHub
parent 6d50717eed
commit 2fd0194e94
3 changed files with 59 additions and 31 deletions

View File

@@ -70,9 +70,9 @@ const LINTERS = [{
test: filename => filename.endsWith('.cc') || (filename.endsWith('.h') && !isObjCHeader(filename)),
run: (opts, filenames) => {
if (opts.fix) {
spawnAndCheckExitCode('python', ['script/run-clang-format.py', '--fix', ...filenames]);
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', '--fix', ...filenames]);
} else {
spawnAndCheckExitCode('python', ['script/run-clang-format.py', ...filenames]);
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', ...filenames]);
}
cpplint(filenames);
}
@@ -82,9 +82,9 @@ const LINTERS = [{
test: filename => filename.endsWith('.mm') || (filename.endsWith('.h') && isObjCHeader(filename)),
run: (opts, filenames) => {
if (opts.fix) {
spawnAndCheckExitCode('python', ['script/run-clang-format.py', '--fix', ...filenames]);
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', '--fix', ...filenames]);
} else {
spawnAndCheckExitCode('python', ['script/run-clang-format.py', ...filenames]);
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', ...filenames]);
}
const filter = [
'-readability/braces',