Fourth batch
[gitweb.git] / ci / run-static-analysis.sh
index 68dd0f080e88983a1be250ed2e4c9f9d8cf144f2..a19aa7ebbc0931fa56acfccdcc0d8bc1ad94ea2c 100755 (executable)
@@ -3,6 +3,27 @@
 # Perform various static code analysis checks
 #
 
-. ${0%/*}/lib-travisci.sh
+. ${0%/*}/lib.sh
 
 make 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