From 75f3886812a70aa7821d3de38bf2e8c94cfd9ef4 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 22 Nov 2022 08:59:09 +1100 Subject: [PATCH] Add cargo fmt to pre-commit githook To save devs getting frustrated by CI; add a call to `cargo +nightly fmt` to our git pre-commit hook. --- githooks/pre-commit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/githooks/pre-commit b/githooks/pre-commit index cabd06f..1a964bb 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -48,3 +48,6 @@ git diff-index --check --cached $against -- || exit 1 # Check that code lints cleanly. cargo clippy --features=rand-std,recovery,lowmemory,global-context --all-targets -- -D warnings || exit 1 + +# Check that there are no formatting issues. +cargo +nightly fmt --check || exit 1