From e2e465056c84bf77ed39ac756514d65350d056ca Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 23 Jun 2022 14:10:20 +1000 Subject: [PATCH] Add clippy to pre-commit githook We have a `pre-commit` githook, add to it a call to `cargo clippy`. --- githooks/pre-commit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/githooks/pre-commit b/githooks/pre-commit index 4d6dde6ba7..dc0fa1bf2b 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -43,4 +43,7 @@ EOF fi # If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- +git diff-index --check --cached $against -- || exit 1 + +# Check that code lints cleanly. +cargo clippy --all-features -- -D warnings || exit 1