commit b0459de217cdc18d20754ad1495ed1da52885c81 parent a7599c5be2cd9b02a2b0e9760a6762a623fd0d7b Author: Nick Mathewson <nickm@torproject.org> Date: Tue, 23 Apr 2019 12:51:44 -0400 Merge branch 'ticket30051_take2_squashed' Diffstat:
| A | changes/ticket30051 | | | 5 | +++++ |
| M | scripts/git/pre-commit.git-hook | | | 4 | ++++ |
| M | scripts/git/pre-push.git-hook | | | 6 | ++++++ |
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/changes/ticket30051 b/changes/ticket30051 @@ -0,0 +1,5 @@ + o Minor features (developer tooling): + - Call practracker from pre-push and pre-commit git hooks to let a + developer know if they made any code style violations in their last + commit. This should help preventing code style violations appearing + upstream. Closes ticket 30051. diff --git a/scripts/git/pre-commit.git-hook b/scripts/git/pre-commit.git-hook @@ -39,3 +39,7 @@ fi if test -e scripts/maint/checkIncludes.py; then python scripts/maint/checkIncludes.py fi + +if [ -e scripts/maint/practracker/practracker.py ]; then + python3 ./scripts/maint/practracker/practracker.py "$workdir" +fi diff --git a/scripts/git/pre-push.git-hook b/scripts/git/pre-push.git-hook @@ -34,6 +34,12 @@ if [ -x "$workdir/.git/hooks/pre-commit" ]; then fi fi +if [ -e scripts/maint/practracker/practracker.py ]; then + if ! python3 ./scripts/maint/practracker/practracker.py "$workdir"; then + exit 1 + fi +fi + # shellcheck disable=SC2034 while read -r local_ref local_sha remote_ref remote_sha do