Skip to content

Commit

Permalink
#1307 improve dev flow of interacting with pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
macgills committed Jul 26, 2019
1 parent 5756b38 commit 677cd2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions team-props/git-hooks/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh

echo "Running formatter..."
# Format code using KtLint, analyze with KtLint & Lint
echo "Running lint..."

./gradlew app:ktlintKiwixDebugFormat app:ktlintKiwixDebugCheck app:lintKiwixDebug --daemon
./gradlew app:ktlintKiwixDebugCheck app:lintKiwixDebug --daemon

status=$?

if [ "$status" = 0 ] ; then
echo "Static analysis found no problems."
exit 0
else
echo 1>&2 "Static analysis found violations it could not fix."
./gradlew app:ktlintKiwixDebugFormat --daemon
echo 1>&2 "Static analysis found violations and attempted to autofix, please commit these autoformat changes"
exit 1
fi

0 comments on commit 677cd2c

Please sign in to comment.