Merge branch 'nd/attr-pathspec-in-tree-walk'
[git.git] / ci / run-static-analysis.sh
blob5688f261d0813d4b2b55baeb5e404fcfef80b5d7
1 #!/bin/sh
3 # Perform various static code analysis checks
6 . ${0%/*}/lib-travisci.sh
8 make --jobs=2 coccicheck
10 set +x
12 fail=
13 for cocci_patch in contrib/coccinelle/*.patch
15 if test -s "$cocci_patch"
16 then
17 echo "$(tput setaf 1)Coccinelle suggests the following changes in '$cocci_patch':$(tput sgr0)"
18 cat "$cocci_patch"
19 fail=UnfortunatelyYes
21 done
23 if test -n "$fail"
24 then
25 echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)"
26 exit 1
29 save_good_tree