diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-12-01 16:34:09 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-12-03 12:06:51 +0100 |
commit | 0c8eeea665a783b8fe82c2b6d9f01cad6cb1054e (patch) | |
tree | 00b3b5db49b124f1fe85da47a4d5d1fad58c4c04 /scripts/clang-tidy.sh | |
parent | 678a5ca91e7e763efc5140102ea9d537b05308e4 (diff) | |
download | qtlocation-mapboxgl-0c8eeea665a783b8fe82c2b6d9f01cad6cb1054e.tar.gz |
[build] add make target "tidy" for running clang-tidy
Diffstat (limited to 'scripts/clang-tidy.sh')
-rwxr-xr-x | scripts/clang-tidy.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/clang-tidy.sh b/scripts/clang-tidy.sh new file mode 100755 index 0000000000..a0a0aa20e4 --- /dev/null +++ b/scripts/clang-tidy.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +command -v ${CLANG_TIDY:-clang-tidy} >/dev/null 2>&1 || { + echo "Can't find ${CLANG_TIDY:-clang-tidy} in PATH." + if [ -z ${CLANG_TIDY} ]; then + echo "Alternatively, you can set CLANG_TIDY to point to clang-tidy." + fi + exit 1 +} + +cd build/${HOST}-${HOST_VERSION}/${BUILDTYPE} + +git ls-files '../../../src/mbgl/*.cpp' '../../../platform/*.cpp' '../../../test/*.cpp' | \ + xargs -I{} -P ${JOBS} ${CLANG_TIDY:-clang-tidy} -header-filter='\/mbgl\/' {} |