From 2d6467f980276f83d244551ba7432ac53610b7a8 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 21 Jul 2022 10:35:29 +1000 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 dc0fa1bf..5bb2c486 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -47,3 +47,6 @@ git diff-index --check --cached $against -- || exit 1 # Check that code lints cleanly. cargo clippy --all-features -- -D warnings || exit 1 + +# Check that there are no formatting issues. +cargo +nightly fmt --check || exit 1