scripts: Add uncrustify scripts for reformatting fprintd source code

We follow libfprint here, using GNOME format
This commit is contained in:
Marco Trevisan (Treviño)
2020-12-03 23:53:27 +01:00
parent 4a80bfacec
commit c18ebaf9da
2 changed files with 156 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 '.*\.[ch]$' | grep -v build/`
RES=$?
popd
exit $RES