scripts: Add an uncrustify script

It currently will only uncrustify the new internal libfprint code, not
the drivers or other parts.
This commit is contained in:
Benjamin Berg
2019-07-03 23:52:56 +02:00
parent 6ec11a2b26
commit dac489b7f6
2 changed files with 158 additions and 0 deletions

19
scripts/uncrustify.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
SRCROOT=`git rev-parse --show-toplevel`
CFG="$SRCROOT/scripts/uncrustify.cfg"
echo "srcroot: $SRCROOT"
case "$1" in
-c|--check)
OPTS="--check"
;;
*)
OPTS="--replace --no-backup"
;;
esac
pushd "$SRCROOT"
uncrustify -c "$CFG" $OPTS `git ls-tree --name-only -r HEAD | grep -E '(fp|fpi)-.*\.[ch]$' | grep -v nbis | grep -v fpi-byte | grep -v build/`
RES=$?
popd
exit $RES