File: uncrustify.sh

package info (click to toggle)
bolt 0.9.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,844 kB
  • sloc: ansic: 29,085; python: 2,938; xml: 460; javascript: 269; sh: 166; makefile: 14
file content (20 lines) | stat: -rwxr-xr-x 375 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 \\\.[c]$ | grep -v gvdb | grep -v build/`
RES=$?
popd
exit $RES