feat: add git pre-push hooks (#432)

- Add cargo-husky for automatic hook installation
- Run cargo sqlx prepare --check before push
- Run cargo clippy with warnings as errors before push

Closes #403
This commit is contained in:
NathanJ60
2025-12-13 10:32:34 +01:00
committed by GitHub
parent 2e9b4f1a33
commit d50c9e38d3
2 changed files with 20 additions and 0 deletions

15
.cargo-husky/hooks/pre-push Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
echo "=== Pre-push checks ==="
echo "Checking sqlx prepare in backend/storage..."
(cd backend/storage && cargo sqlx prepare --check)
echo "Checking sqlx prepare in shared..."
(cd shared && cargo sqlx prepare --check)
echo "Running cargo clippy..."
cargo clippy --all-targets -- -D warnings
echo "=== All checks passed! ==="

View File

@@ -24,3 +24,8 @@ utoipa = { version = "5.3.1", features = ["actix_extras"] }
indexmap = { version = "2.11.0", default-features = false, features = ["std", "serde"] }
regex = "1.11.1"
arcadia-shared = { path = "../../shared" }
[dev-dependencies.cargo-husky]
version = "1.5"
default-features = false
features = ["user-hooks"]