forked from colognechip/mISDN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckall.sh
executable file
·52 lines (45 loc) · 845 Bytes
/
checkall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
KERNELDIR=/usr/src/linux
VERBOSE=false
usage() {
cat<<EOM
checkall.sh is used for checking files for being conform to the Linux
kernel style
checkall.sh [-h] [-k DIR]
Options:
-h This Text.
-k DIR Kerneltree is in DIR instead of /usr/src/linux
-v list all issues
EOM
exit
}
while getopts hk:v a ; do
case $a in
\?) case $OPTARG in
k) echo "-k requires Kernel directory parameter"
;;
*) echo "Unknown option: -$OPTARG"
echo "Try std2kern -h"
;;
esac
exit 1
;;
k)
KERNELDIR=$OPTARG
;;
h) usage
;;
v) VERBOSE=true
;;
esac
done
shift `expr $OPTIND - 1`
CHECKCMD="$KERNELDIR/scripts/checkpatch.pl --file --strict --summary-file"
FILES=`find . -name '*.[hc]'`
for f in $FILES; do
if $VERBOSE; then
$CHECKCMD $f
else
$CHECKCMD $f | grep "lines checked"
fi
done