From c7115dab0aac372efb0165314e0aff8596de51b0 Mon Sep 17 00:00:00 2001 From: Trezy Date: Fri, 13 Feb 2026 14:10:49 -0600 Subject: [PATCH] ci: add pre-commit hook for rustfmt and clippy --- scripts/pre-commit | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/pre-commit diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..b7a23c1 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,15 @@ +#!/bin/sh + +# Run rustfmt check +cargo fmt -- --check +if [ $? -ne 0 ]; then + echo "rustfmt check failed. Run 'cargo fmt' to fix." + exit 1 +fi + +# Run clippy +cargo clippy --all-targets -- -D warnings +if [ $? -ne 0 ]; then + echo "clippy check failed. Fix the warnings above." + exit 1 +fi -- 2.51.2