mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-05 02:11:32 +00:00
Make use of git ls-files
filtering instead of piping to grep
This commit is contained in:
parent
66e14fa3bd
commit
7c485fae0c
1 changed files with 1 additions and 3 deletions
|
@ -3,8 +3,6 @@
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
CLANG_FORMAT="${CLANG_FORMAT:-clang-format}"
|
CLANG_FORMAT="${CLANG_FORMAT:-clang-format}"
|
||||||
git ls-files |
|
git ls-files -- ':(exclude)extern/' '*.cpp' '*.hpp' '*.h' |
|
||||||
grep -v '^extern/' |
|
|
||||||
grep -P '\.(cpp|hpp|h)$' |
|
|
||||||
xargs -I '{}' -P $(nproc) bash -ec "\"${CLANG_FORMAT:?}\" --dry-run -Werror \"\${0:?}\" &> /dev/null || \"${CLANG_FORMAT:?}\" \"\${0:?}\" | git diff --color=always --no-index \"\${0:?}\" -" '{}' ||
|
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 )
|
( echo "clang-format differences detected"; exit -1 )
|
||||||
|
|
Loading…
Reference in a new issue