Add precommit script (#3018)

* Add precommit script

* Merge stuff
This commit is contained in:
Dominik Maier 2025-02-21 12:57:44 +01:00 committed by GitHub
parent df7e51ed42
commit 5746df835e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -4,7 +4,4 @@
## Checklist
Please make sure you've completed the following steps before submitting:
- [ ] I have run `./script/fmt_all.sh` to format the code
- [ ] I have run `./script/clippy.sh` and fixed all errors/warnings
- [ ] I have run `./scripts/precommit.sh` and addressed all comments

13
scripts/precommit.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR/.." || exit 1
echo "[*] Formatting this beautiful code"
echo
"$SCRIPT_DIR"/fmt_all.sh || exit 1
echo
echo "[*] Asking clippy how to excel"
echo
"$SCRIPT_DIR"/fmt_all.sh || exit 1
echo
echo "[!] All done. Ready to commit!"