From 5fd2ecf28e478347d136901e3718967616bdc050 Mon Sep 17 00:00:00 2001 From: xenua Date: Wed, 4 Jan 2023 13:05:06 +0100 Subject: [PATCH] add git pre commit hook --- githooks/pre-commit | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 githooks/pre-commit 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