Skip to content

Instantly share code, notes, and snippets.

@grndvl1
Created October 13, 2023 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grndvl1/6057d1b12ab91a5e2b5c72a43ad193fb to your computer and use it in GitHub Desktop.
Save grndvl1/6057d1b12ab91a5e2b5c72a43ad193fb to your computer and use it in GitHub Desktop.
Pre-Commit File for Android Studio KTLint Check
#!/bin/bash
echo "Validating code format"
./gradlew app:ktlintCheck --daemon
STATUS=$?
# Exit with an error if the linter didn't pass
[ $STATUS -ne 0 ] && exit 1
exit 0
# Add this file to your .git/hooks directory and make sure it has execute perms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment