aboutsummaryrefslogtreecommitdiff
path: root/format.sh
blob: 5377f2ade003f522b472bf01f7f7f7b6ed0b5542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# format.sh
#
# run clang-format on each .c & .h file

if [ -z "${CLANG_FORMAT}" ]; then
    CLANG_FORMAT=clang-format
fi

a=`git ls-files | grep "\.h$\|\.c$"`
for x in $a; do
     if [ $x != "config_in.h" ]; then
         $CLANG_FORMAT -i -style=file $x
     fi
done