Skip to content

Instantly share code, notes, and snippets.

@iurysza
Created December 20, 2020 19:00
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 iurysza/fc6d0b735089c573aa5b0ce8797ef548 to your computer and use it in GitHub Desktop.
Save iurysza/fc6d0b735089c573aa5b0ce8797ef548 to your computer and use it in GitHub Desktop.
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