mirror of
https://github.com/git/git.git
synced 2026-03-12 09:59:45 +01:00
The Coccinelle tool is an ingrained part of our build infrastructure. It is executed by our CI to detect antipatterns and is used to detect misuses of certain interfaces. It's presence in "contrib/" is thus rather misleading. Promote the configuration into the new "tools/" directory. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
37 lines
551 B
Bash
Executable File
37 lines
551 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Perform various static code analysis checks
|
|
#
|
|
|
|
. ${0%/*}/lib.sh
|
|
|
|
make coccicheck
|
|
|
|
set +x
|
|
|
|
fail=
|
|
for cocci_patch in tools/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 check-headers ||
|
|
exit 1
|
|
|
|
make check-pot
|
|
|
|
${0%/*}/check-unsafe-assertions.sh
|
|
|
|
save_good_tree
|