diff --git a/.husky/pre-push b/.husky/pre-push index c90d45ef..afeed10c 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,13 +1,11 @@ #!/bin/bash -# 运行 clippy -# cargo clippy --manifest-path ./src-tauri/Cargo.toml --fix +if git diff --cached --name-only | grep -q '^src-tauri/'; then + cargo clippy --manifest-path ./src-tauri/Cargo.toml + if [ $? -ne 0 ]; then + echo "Clippy found issues in src-tauri. Please fix them before pushing." + exit 1 + fi +fi -# 如果 clippy 失败,阻止 push -# if [ $? -ne 0 ]; then -# echo "Clippy found issues in sub_crate. Please fix them before pushing." -# exit 1 -# fi - -# 允许 push exit 0