2022-09-25 13:12:48 +00:00
|
|
|
#!/bin/bash -ex
|
2022-09-20 19:03:44 +00:00
|
|
|
|
2022-09-25 13:12:48 +00:00
|
|
|
set -o pipefail
|
2022-09-20 19:03:44 +00:00
|
|
|
|
2022-09-25 13:12:48 +00:00
|
|
|
CLANG_FORMAT="${CLANG_FORMAT:-clang-format}"
|
2022-10-06 20:59:33 +00:00
|
|
|
git ls-files -- ':(exclude)extern/' '*.cpp' '*.hpp' '*.h' |
|
2022-09-25 13:12:48 +00:00
|
|
|
xargs -I '{}' -P $(nproc) bash -ec "\"${CLANG_FORMAT:?}\" --dry-run -Werror \"\${0:?}\" &> /dev/null || \"${CLANG_FORMAT:?}\" \"\${0:?}\" | git diff --color=always --no-index \"\${0:?}\" -" '{}' ||
|
|
|
|
( echo "clang-format differences detected"; exit -1 )
|