Skip to content

Commit

Permalink
CB-8506 - Use npm version of uncrustify in cordova-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron committed Feb 18, 2015
1 parent 7422425 commit 2588a80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions bin/uncrustify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

SCRIPT_PATH=$(dirname $0)
CONFIG="$SCRIPT_PATH/uncrustify.cfg"
EXE="$SCRIPT_PATH/../node_modules/.bin/uncrustify"

function Usage() {
echo "Formats code using uncrustify."
Expand All @@ -32,7 +33,7 @@ function Usage() {
}

function VerifyEnv() {
if ! which uncrustify > /dev/null; then
if ! which "$EXE" > /dev/null; then
echo "uncrustify binary not found. Please ensure that it is in your PATH."
echo "Install via homebrew using: brew install uncrustify"
exit 1
Expand Down Expand Up @@ -77,7 +78,7 @@ elif [[ "$1" = "--all" ]]; then
files=$(find .)
FilterAndRun $files
elif [[ "$1" = "--check-file" ]]; then
uncrustify -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
"$EXE" -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
elif [[ "$1" = "--filter" ]]; then
FilterFileList "$@"
elif [[ "$1" = -* ]]; then
Expand Down
5 changes: 0 additions & 5 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ PATH=$PATH:/usr/local/bin:/usr/local/sbin
exec 1>&2
test $SKIP_UNCRUSTIFY && exit 0

if [[ "$(uncrustify --version | cut -d' ' -f2)" != 0.60 ]]; then
echo "Please install version 0.60 of uncrustify."
exit 1
fi

RET=0
files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only))
MSGS=
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"nodeunit": "^0.8.7"
},
"devDependencies": {
"jshint": "^2.6.0"
"jshint": "^2.6.0",
"uncrustify": "^0.6.1"
}
}

0 comments on commit 2588a80

Please sign in to comment.