File: uncrustify.sh

package info (click to toggle)
bolt 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,788 kB
  • sloc: ansic: 28,869; python: 2,813; xml: 460; javascript: 269; sh: 180; makefile: 13
file content (20 lines) | stat: -rwxr-xr-x 376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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 \\\.[ch]$ | grep -v gvdb | grep -v build/`
RES=$?
popd
exit $RES