aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-15 15:08:21 -0700
committerJunio C Hamano <gitster@pobox.com>2018-08-15 15:08:21 -0700
commit94f879c239aa5bfc671d725621e354a4ef05099d (patch)
tree10954c90126666a349bae26a10f287a5bb6124af
parent10639c395a365ab9e4f71a208746d9fc0236d2bb (diff)
parent0860a7641bae520beceb708b072e0efab197fe9a (diff)
downloadgit-94f879c239aa5bfc671d725621e354a4ef05099d.tar.xz
Merge branch 'sg/travis-cocci-diagnose-failure'
Update the way we run static analysis tool at TravisCI to make it easier to use its findings. * sg/travis-cocci-diagnose-failure: travis-ci: fail if Coccinelle static analysis found something to transform travis-ci: run Coccinelle static analysis with two parallel jobs
-rwxr-xr-xci/run-static-analysis.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh
index fe4ee4e06b..5688f261d0 100755
--- a/ci/run-static-analysis.sh
+++ b/ci/run-static-analysis.sh
@@ -5,6 +5,25 @@
. ${0%/*}/lib-travisci.sh
-make coccicheck
+make --jobs=2 coccicheck
+
+set +x
+
+fail=
+for cocci_patch in contrib/coccinelle/*.patch
+do
+ if test -s "$cocci_patch"
+ then
+ echo "$(tput setaf 1)Coccinelle suggests the following changes in '$cocci_patch':$(tput sgr0)"
+ cat "$cocci_patch"
+ fail=UnfortunatelyYes
+ fi
+done
+
+if test -n "$fail"
+then
+ echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)"
+ exit 1
+fi
save_good_tree