-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: pre-push hook * fix: check * fix: readme and cargo fmt
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
cargo check --all-features | ||
if [ $? -ne 0 ]; then | ||
echo "Pre-push hook failed: cargo check detected errors." | ||
exit 1 | ||
fi | ||
|
||
cargo clippy --workspace --all-features --all-targets -- -D warnings | ||
if [ $? -ne 0 ]; then | ||
echo "Pre-push hook failed: cargo clippy detected warnings or errors." | ||
exit 1 | ||
fi | ||
|
||
cargo +nightly fmt --all --check | ||
if [ $? -ne 0 ]; then | ||
echo "Pre-push hook failed: cargo fmt detected formatting issues." | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cp .hooks/pre-push .git/hooks/pre-push | ||
chmod +x .git/hooks/pre-push | ||
|
||
echo "Git hooks installed successfully." |