Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Perform various static code analysis checks |
| 4 | # |
| 5 | |
Johannes Schindelin | c2160f2 | 2019-01-27 15:26:50 -0800 | [diff] [blame] | 6 | . ${0%/*}/lib.sh |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 7 | |
Johannes Schindelin | eaa6229 | 2019-01-27 15:26:52 -0800 | [diff] [blame] | 8 | make coccicheck |
SZEDER Gábor | 9cc2c76 | 2017-12-31 11:12:05 +0100 | [diff] [blame] | 9 | |
SZEDER Gábor | 0860a76 | 2018-07-23 15:02:30 +0200 | [diff] [blame] | 10 | set +x |
| 11 | |
| 12 | fail= |
| 13 | for cocci_patch in contrib/coccinelle/*.patch |
| 14 | do |
| 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 |
| 20 | fi |
| 21 | done |
| 22 | |
| 23 | if test -n "$fail" |
| 24 | then |
| 25 | echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)" |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Johannes Schindelin | 411e4f4 | 2019-10-01 04:16:26 -0700 | [diff] [blame] | 29 | make hdr-check || |
| 30 | exit 1 |
| 31 | |
SZEDER Gábor | 9cc2c76 | 2017-12-31 11:12:05 +0100 | [diff] [blame] | 32 | save_good_tree |