blob: 65bcebda41a0dfb47676a1d0528fdaa0addf2271 [file] [log] [blame]
Lars Schneider657343a2017-09-10 16:44:28 +02001#!/bin/sh
2#
3# Perform various static code analysis checks
4#
5
Johannes Schindelinc2160f22019-01-27 15:26:50 -08006. ${0%/*}/lib.sh
Lars Schneider657343a2017-09-10 16:44:28 +02007
Johannes Schindelineaa62292019-01-27 15:26:52 -08008make coccicheck
SZEDER Gábor9cc2c762017-12-31 11:12:05 +01009
SZEDER Gábor0860a762018-07-23 15:02:30 +020010set +x
11
12fail=
13for cocci_patch in contrib/coccinelle/*.patch
14do
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
21done
22
23if test -n "$fail"
24then
25 echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)"
26 exit 1
27fi
28
Johannes Schindelin411e4f42019-10-01 04:16:26 -070029make hdr-check ||
30exit 1
31
SZEDER Gábor9cc2c762017-12-31 11:12:05 +010032save_good_tree