Created
July 5, 2021 07:44
-
-
Save ashishuniyal90/8ecd2ed0a279f5cde20481062e663469 to your computer and use it in GitHub Desktop.
Ktlint Pre-Commit hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "*********************************************************" | |
echo "Running git pre-commit hook. Running Static analysis... " | |
echo "*********************************************************" | |
./gradlew ktlintCheck | |
status=$? | |
if [ "$status" = 0 ] ; then | |
echo "Static analysis found no problems." | |
exit 0 | |
else | |
echo "*********************************************************" | |
echo " ******************************************** " | |
echo 1>&2 "Static analysis found violations it could not fix." | |
echo "Run ./gradlew ktlintFormat to fix formatting related issues..." | |
echo " ******************************************** " | |
echo "*********************************************************" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment