move tools to hooks

This commit is contained in:
Mario Voigt 2025-02-25 12:36:42 +01:00
parent 0cb6ffe6c1
commit 1406f38aa3
2 changed files with 15 additions and 0 deletions

3
hooks/git-pre-commit-hook Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
cargo fmt --all

12
hooks/git-pre-push-hook Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
echo -e "Checking code formatting:\n=========================\n\n" 1>&2
cargo fmt --check
if [[ $? -ne 0 ]]
then
o=$?
echo -e "\n\nRun \`cargo fmt --all\` before pushing please." 1>&2
exit $o
fi