[tidy] Bail out when a warning/error is found
This commit is contained in:
@@ -17,5 +17,18 @@ command -v ${CLANG_TIDY} >/dev/null 2>&1 || {
|
||||
|
||||
cd $1
|
||||
|
||||
function check_tidy() {
|
||||
OUTPUT=$(${CLANG_TIDY} $0 -p=. -header-filter='mbgl' 2>/dev/null)
|
||||
if [[ -n $OUTPUT ]]; then
|
||||
echo "Error: A clang-tidy warning/error happened:"
|
||||
echo -e "$OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
export CLANG_TIDY
|
||||
export -f check_tidy
|
||||
|
||||
echo "Running clang-tidy checks... (this might take a while)"
|
||||
git ls-files '../../../src/mbgl/*.cpp' '../../../platform/*.cpp' '../../../test/*.cpp' | \
|
||||
xargs -I{} -P ${JOBS} ${CLANG_TIDY} {} -p=. -header-filter='mbgl' || exit 1
|
||||
xargs -I{} -P ${JOBS} bash -c 'check_tidy' {}
|
||||
|
||||
Reference in New Issue
Block a user