diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..cb46eb54 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +# Run the Rust formatter on all files +cargo +nightly fmt --all +# Re-stage files that were modified by the formatter +git add -u diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 00000000..f76bbd4e --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,3 @@ +#!/bin/sh +# Run tests before pushing. If tests fail, the push is aborted. +cargo test