Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Last active December 15, 2017 13:19
Show Gist options
  • Save mariusbutuc/8f1e6c6b22dbe7769b028b4134f2ec08 to your computer and use it in GitHub Desktop.
Save mariusbutuc/8f1e6c6b22dbe7769b028b4134f2ec08 to your computer and use it in GitHub Desktop.
# .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