https://github.com/git/git
Raw File
Tip revision: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 authored by Junio C Hamano on 16 August 2019, 17:28:23 UTC
Git 2.23
Tip revision: 5fa0f52
run-static-analysis.sh
#!/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

save_good_tree
back to top