libfprint/scripts/uncrustify.sh
Benjamin Berg dac489b7f6 scripts: Add an uncrustify script
It currently will only uncrustify the new internal libfprint code, not
the drivers or other parts.
2019-11-20 13:53:45 +01:00

19 lines
No EOL
407 B
Bash
Executable file

#!/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