diff --git a/contrib/pre-commit b/contrib/pre-commit new file mode 100644 index 0000000..708a39d --- /dev/null +++ b/contrib/pre-commit @@ -0,0 +1,11 @@ +#!/bin/bash + +# Run make fmt before committing +# Run make fmt +make fmt + +# If make fmt fails, prevent the commit +if [ $? -ne 0 ]; then + echo "Error: make fmt failed. Please fix formatting issues before committing." + exit 1 +fi