#1307 improve dev flow of interacting with pre-commit hook

This commit is contained in:
Sean Mac Gillicuddy 2019-07-26 10:25:53 +01:00
parent 5756b3894a
commit 677cd2cdac

View File

@ -1,9 +1,8 @@
#!/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=$?
@ -11,6 +10,7 @@ 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