diff --git a/.githook/pre-commit-default.sh b/.githook/pre-commit-default.sh index 0561bb48b..b4e582905 100644 --- a/.githook/pre-commit-default.sh +++ b/.githook/pre-commit-default.sh @@ -2,9 +2,15 @@ echo "Running git pre-commit hook" -./gradlew formatKotlin +./gradlew lintKotlin status=$? -[ $status -ne 0 ] && exit 1 +if [ $status -ne 0 ]; then + echo "#######################################################" + echo "#Lint failed, commit aborted. Please run formatKotlin.#" + echo "#######################################################" + exit 1 +fi + exit 0 diff --git a/.githook/pre-commit-macos.sh b/.githook/pre-commit-macos.sh index 0561bb48b..b4e582905 100644 --- a/.githook/pre-commit-macos.sh +++ b/.githook/pre-commit-macos.sh @@ -2,9 +2,15 @@ echo "Running git pre-commit hook" -./gradlew formatKotlin +./gradlew lintKotlin status=$? -[ $status -ne 0 ] && exit 1 +if [ $status -ne 0 ]; then + echo "#######################################################" + echo "#Lint failed, commit aborted. Please run formatKotlin.#" + echo "#######################################################" + exit 1 +fi + exit 0 diff --git a/.githook/pre-commit-windows.sh b/.githook/pre-commit-windows.sh index cbe981ec8..e5b1120f1 100644 --- a/.githook/pre-commit-windows.sh +++ b/.githook/pre-commit-windows.sh @@ -2,9 +2,15 @@ echo "Running git pre-commit hook" -./gradlew formatKotlin +./gradlew lintKotlin status=$? -[ $status -ne 0 ] && exit 1 +if [ $status -ne 0 ]; then + echo "#######################################################" + echo "#Lint failed, commit aborted. Please run formatKotlin.#" + echo "#######################################################" + exit 1 +fi + exit 0