Skip to content

Instantly share code, notes, and snippets.

@IvanIvanoff
Last active October 23, 2022 07:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanIvanoff/7586e7c1b32f44b301709a7bb3696279 to your computer and use it in GitHub Desktop.
Save IvanIvanoff/7586e7c1b32f44b301709a7bb3696279 to your computer and use it in GitHub Desktop.
pre-commit hook for checking mix formatting
#!/bin/bash
cd `git rev-parse --show-toplevel`
echo "Running pre-commit hook: Check elixir formatting with mix format"
mix format --check-formatted
if [ $? == 1 ]; then
echo "mix format --check-formatted found formatting issues."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment