summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@gmail.com>2019-04-02 16:44:02 -0400
committerGitHub <noreply@github.com>2019-04-02 16:44:02 -0400
commitbf21fa1ff8412089606c6c3aa4cc0dbebfe91b2d (patch)
treef6fa6394c67f4e177145d2b9bf997bff18f245e9 /scripts
parent2455275bf47e1671a92eb2c1296c6b48f11f6b2e (diff)
downloadqtlocation-mapboxgl-bf21fa1ff8412089606c6c3aa4cc0dbebfe91b2d.tar.gz
[core] Adds target branch parameter to clang-tools.sh (#14301)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/clang-tools.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh
index bdda4544b9..1e73951176 100755
--- a/scripts/clang-tools.sh
+++ b/scripts/clang-tools.sh
@@ -33,7 +33,7 @@ function run_clang_tidy() {
}
function run_clang_tidy_diff() {
- OUTPUT=$(git diff origin/master --src-prefix=${CDUP} --dst-prefix=${CDUP} | \
+ OUTPUT=$(git diff origin/$2 --src-prefix=${CDUP} --dst-prefix=${CDUP} | \
${CLANG_TIDY_PREFIX}/share/clang-tidy-diff.py \
-clang-tidy-binary ${CLANG_TIDY} \
2>/dev/null)
@@ -45,7 +45,7 @@ function run_clang_tidy_diff() {
function run_clang_format() {
echo "Running clang-format on $0..."
- DIFF_FILES=$(git diff origin/master --name-only *cpp)
+ DIFF_FILES=$(git diff origin/$2 --name-only *cpp)
echo "${DIFF_FILES}" | xargs -I{} -P ${JOBS} bash -c 'run_clang_format' {}
${CLANG_FORMAT} -i ${CDUP}/$0 || exit 1
}
@@ -54,7 +54,7 @@ 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
+if [[ -n $3 ]] && [[ $3 == "--diff" ]]; then
run_clang_tidy_diff $@
# XXX disabled until we run clang-format over the entire codebase.
#run_clang_format $@