chore: git hooks for linter and formatter

This commit is contained in:
Tunglies
2025-03-13 12:51:20 +08:00
parent f7f15544ba
commit a7f66c3d65
50 changed files with 479 additions and 375 deletions

13
.husky/pre-push Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# 运行 clippy
cargo clippy --manifest-path ./src-tauri/Cargo.toml --fix
# 如果 clippy 失败,阻止 push
if [ $? -ne 0 ]; then
echo "Clippy found issues in sub_crate. Please fix them before pushing."
exit 1
fi
# 允许 push
exit 0