From 677cd2cdac9299234ce86ceb659ce791efb90502 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Fri, 26 Jul 2019 10:25:53 +0100 Subject: [PATCH] #1307 improve dev flow of interacting with pre-commit hook --- team-props/git-hooks/pre-commit.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/team-props/git-hooks/pre-commit.sh b/team-props/git-hooks/pre-commit.sh index 2e88dc812..eb4086362 100644 --- a/team-props/git-hooks/pre-commit.sh +++ b/team-props/git-hooks/pre-commit.sh @@ -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