diff --git a/githooks/pre-commit b/githooks/pre-commit new file mode 100755 index 0000000..c25e388 --- /dev/null +++ b/githooks/pre-commit @@ -0,0 +1,10 @@ +#!/bin/sh +# pre-commit hook + +# check formatting +if ! cargo fmt --check --quiet ; then + echo "error: run cargo fmt before committing" + exit 1 +else + echo "cargo fmt checked successfully" +fi