diff --git a/tools/git-pre-push-hook b/tools/git-pre-push-hook new file mode 100755 index 0000000..b47425a --- /dev/null +++ b/tools/git-pre-push-hook @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +echo -e "Checking code formatting:\n=========================\n\n" 1>&2 + +cargo fmt --check + +if [[ $? -ne 0 ]] +then + o=$? + echo -e "\n\nRun \`cargo fmt --all\` before pushing please." 1>&2 + exit $o +fi