run-static-analysis.sh 497 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #
  3. # Perform various static code analysis checks
  4. #
  5. . ${0%/*}/lib.sh
  6. make coccicheck
  7. set +x
  8. fail=
  9. for cocci_patch in contrib/coccinelle/*.patch
  10. do
  11. if test -s "$cocci_patch"
  12. then
  13. echo "$(tput setaf 1)Coccinelle suggests the following changes in '$cocci_patch':$(tput sgr0)"
  14. cat "$cocci_patch"
  15. fail=UnfortunatelyYes
  16. fi
  17. done
  18. if test -n "$fail"
  19. then
  20. echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)"
  21. exit 1
  22. fi
  23. make hdr-check ||
  24. exit 1
  25. save_good_tree