diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..27236a0 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,11 @@ +#!/bin/bash + +diff=$(cargo fmt -- --check) +result=$? + +if [ ${result} -ne 0 ]; then + echo "There are some code formatting issues, run `cargo fmt` first." + exit 1 +fi + +exit 0