1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 14:56:12 +02:00
git/ci/run-static-analysis.sh
Johannes Schindelin 411e4f4735 ci: run `hdr-check` as part of the `Static Analysis` job
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-03 10:34:57 +09:00

33 lines
497 B
Bash
Executable File

#!/bin/sh
#
# Perform various static code analysis checks
#
. ${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
make hdr-check ||
exit 1
save_good_tree