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!"