summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-05-15 15:06:15 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-05-15 15:16:15 +0300
commitd4f6cac686bdd92b913a8877c5a984dc0082b7a8 (patch)
tree05d77fe947ca06451a3f407448bae150f25661ef
parentb3ec985568176b077756b66754470988436d43c1 (diff)
downloadqtlocation-mapboxgl-d4f6cac686bdd92b913a8877c5a984dc0082b7a8.tar.gz
[tidy] run-clang-tidy.py reads source files from compile_commands.json
-rwxr-xr-xscripts/clang-tools.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh
index 48675e3ab1..0debe931a7 100755
--- a/scripts/clang-tools.sh
+++ b/scripts/clang-tools.sh
@@ -19,17 +19,13 @@ for CLANG_FILE in "${CLANG_TIDY} ${CLANG_APPLY} ${CLANG_FORMAT}"; do
}
done
-cd $1
-
-export CDUP=$(git rev-parse --show-cdup)
export CLANG_TIDY CLANG_APPLY CLANG_FORMAT
function run_clang_tidy() {
- FILES=$(git ls-files "src/mbgl/*.cpp" "platform/*.cpp" "test/*.cpp")
${CLANG_TIDY_PREFIX}/share/run-clang-tidy.py -j ${JOBS} \
-clang-tidy-binary ${CLANG_TIDY} \
-clang-apply-replacements-binary ${CLANG_APPLY} \
- -fix ${FILES} 2>/dev/null || exit 1
+ -p $1 -fix 2>/dev/null || exit 1
}
function run_clang_tidy_diff() {
@@ -55,6 +51,8 @@ export -f run_clang_tidy run_clang_tidy_diff run_clang_format
echo "Running Clang checks... (this might take a while)"
if [[ -n $2 ]] && [[ $2 == "--diff" ]]; then
+ cd $1
+ export CDUP=$(git rev-parse --show-cdup)
run_clang_tidy_diff $@
# XXX disabled until we run clang-format over the entire codebase.
#run_clang_format $@