diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-13 20:58:22 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-13 23:34:43 +0300 |
commit | 9a43768667833d23df09782bdb6a2ca582c97b82 (patch) | |
tree | 7962f9e944cf8ca96d319ade9d35f16d7a1afa57 /scripts | |
parent | fe09510c1bca4d71e196314dca83f6b5ece26b5a (diff) | |
download | qtlocation-mapboxgl-9a43768667833d23df09782bdb6a2ca582c97b82.tar.gz |
[tidy] Bail out when a warning/error is found
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/clang-tidy.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/clang-tidy.sh b/scripts/clang-tidy.sh index e6bb3794a2..cd61a5c48e 100755 --- a/scripts/clang-tidy.sh +++ b/scripts/clang-tidy.sh @@ -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' {} |