Skip to content

Instantly share code, notes, and snippets.

@iurysza
Created December 20, 2020 19:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Runs static analysis before every commit
#!/bin/bash
echo "Running git pre-commit hook"
./gradlew ktlintCi
./gradlew detektCi
RESULT=$?
# return 1 exit code if running checks fails
[[ ${RESULT} -ne 0 ]] && exit 1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment