diff --git a/README.md b/README.md index 518c175d0..2d0352d53 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Tips for a successful Pull Request 1. Squash your commits -- Keep the changes simple to read. -2. Run the schema check -- Make sure the changes are valid! -3. Sign your commit -- Makes it easier to verify. -4. Bonus: add your pgp fingerprint to your MNT `auth: pgp-fingerprint ` [[See XUU-MNT example](data/mntner/XUU-MNT)] -3. ??? -4. Profit! +2. Run the schema check -- Make sure the changes are valid! Run `./check-my-stuff YOUROWN-MNT` +3. BONUS: install the commit hook! Run `./install-commit-hook YOUROWN-MNT` +4. Sign your commit -- Makes it easier to verify. +5. Bonus: add your pgp fingerprint to your MNT `auth: pgp-fingerprint ` [[See XUU-MNT example](data/mntner/XUU-MNT)] +6. ??? +7. Profit! diff --git a/check-my-stuff b/check-my-stuff index 64680c209..d5875b708 100755 --- a/check-my-stuff +++ b/check-my-stuff @@ -6,8 +6,9 @@ if [ $# -eq 0 ] exit fi -BASE=$(realpath $0) -BASE=$(dirname $BASE) -cd $BASE +BASE="$(realpath "$0")" +BASE="$(dirname "$BASE")" +cd "$BASE" || exit 1 + +utils/schema-check/dn42-schema.py scan data/ -m "$1" || ( echo "Schema validation failed, please check above!" ; exit 1 ) -utils/schema-check/dn42-schema.py scan data/ -m $1 diff --git a/install-commit-hook b/install-commit-hook new file mode 100755 index 000000000..63a3d965c --- /dev/null +++ b/install-commit-hook @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ $# -eq 0 ] + then + echo "Usage: $0 YOUR-MNT" + exit +fi + +BASE="$(realpath "$0")" +BASE="$(dirname "$BASE")" +cd "$BASE" || exit 1 + +cat > .git/hooks/pre-commit <