From a85cd5b41bbd71cd16a9a641e067faf4cafb313e Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 19 Apr 2019 09:46:36 +0300 Subject: [PATCH 1/2] Call practracker from pre-push and pre-commit hooks --- scripts/git/pre-commit.git-hook | 4 ++++ scripts/git/pre-push.git-hook | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/scripts/git/pre-commit.git-hook b/scripts/git/pre-commit.git-hook index 65fa99f4c4..76d13adeb9 100755 --- 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 index f329829346..740180d6f6 100755 --- 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 From 0c78811ceabaece8bec92cc6a9a42a7b4631cfa7 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 19 Apr 2019 09:51:04 +0300 Subject: [PATCH 2/2] Add changes file --- changes/ticket30051 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/ticket30051 diff --git a/changes/ticket30051 b/changes/ticket30051 new file mode 100644 index 0000000000..87b6d7611f --- /dev/null +++ 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.