1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 12:20:41 +00:00
OpenMW/CI/check_clang_format.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
399 B
Bash
Raw Normal View History

#!/bin/bash -ex
set -o pipefail
CLANG_FORMAT="${CLANG_FORMAT:-clang-format}"
git ls-files -- ':(exclude)extern/' '*.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:?}\" -" '{}' ||
( echo "clang-format differences detected"; exit -1 )