Last active
January 18, 2024 01:42
-
-
Save DefectingCat/e280b1c6cf422169862be041225975ff to your computer and use it in GitHub Desktop.
Rust git pre commit hooks
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
#!/bin/sh | |
set -eu | |
if ! cargo fmt -- --check; then | |
echo "There are some code style issues." | |
echo "Run cargo fmt first." | |
exit 1 | |
fi | |
if ! cargo clippy --all-targets -- -D warnings; then | |
echo "There are some clippy issues." | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment