From 5746df835eef9af1d8f53e1d280adfab18f9ebad Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 21 Feb 2025 12:57:44 +0100 Subject: [PATCH] Add precommit script (#3018) * Add precommit script * Merge stuff --- .github/PULL_REQUEST_TEMPLATE.md | 5 +---- scripts/precommit.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 scripts/precommit.sh diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fea6830033..32d20dee4d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 diff --git a/scripts/precommit.sh b/scripts/precommit.sh new file mode 100755 index 0000000000..1740315cdb --- /dev/null +++ b/scripts/precommit.sh @@ -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!"