summaryrefslogtreecommitdiff
path: root/scripts/clang-tools.sh
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-06-03 18:05:04 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commit692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6 (patch)
tree1d08af7d56e986dba2b548ff9b9a7e1a77c713ed /scripts/clang-tools.sh
parente3ee55b28d0b230d054c9718f79a1f6d685cd62b (diff)
downloadqtlocation-mapboxgl-692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6.tar.gz
[build] switch to CMake
This is very much a work in progress.
Diffstat (limited to 'scripts/clang-tools.sh')
-rwxr-xr-xscripts/clang-tools.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh
index f26b065263..6a10740c77 100755
--- a/scripts/clang-tools.sh
+++ b/scripts/clang-tools.sh
@@ -18,6 +18,8 @@ command -v ${CLANG_TIDY} >/dev/null 2>&1 || {
cd $1
+CDUP=$(git rev-parse --show-cdup)
+
function check_tidy() {
echo "Running clang-tidy on $0..."
if [[ -n $1 ]] && [[ $1 == "--fix" ]]; then
@@ -34,7 +36,7 @@ function check_tidy() {
function check_format() {
echo "Running clang-format on $0..."
- ${CLANG_FORMAT} -i ../../../$0
+ ${CLANG_FORMAT} -i ${CDUP}/$0
}
export CLANG_TIDY CLANG_FORMAT
@@ -61,6 +63,6 @@ if [ -n $2 ] && [ $2 == "--diff" ]; then
fi
echo "All looks good!"
else
- git ls-files '../../../src/mbgl/*.cpp' '../../../platform/*.cpp' '../../../test/*.cpp' | \
+ git ls-files '${CDUP}/src/mbgl/*.cpp' '${CDUP}/platform/*.cpp' '${CDUP}/test/*.cpp' | \
xargs -I{} -P ${JOBS} bash -c 'check_tidy' {}
fi