Last active
December 15, 2017 13:19
-
-
Save mariusbutuc/8f1e6c6b22dbe7769b028b4134f2ec08 to your computer and use it in GitHub Desktop.
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
# .git/hooks/pre-push | |
#!/usr/bin/env bash | |
set -e | |
trap 'echo interrupted; exit' INT | |
cd $(git rev-parse --show-toplevel) | |
if [ -f "mix.exs" ]; then | |
mix compile --warnings-as-errors | |
mix test | |
fi | |
if [ -f "mix.lock" ]; then | |
if grep -q ' "credo": {' "mix.lock"; then | |
mix credo --all | |
fi | |
if grep -q ' "dialyxir": {' "mix.lock"; then | |
mix dialyzer --halt-exit-status | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment