Просмотр исходного кода

Merge branch 'ticket30051_take2_squashed'

Nick Mathewson 5 лет назад
Родитель
Сommit
b0459de217
3 измененных файлов с 15 добавлено и 0 удалено
  1. 5 0
      changes/ticket30051
  2. 4 0
      scripts/git/pre-commit.git-hook
  3. 6 0
      scripts/git/pre-push.git-hook

+ 5 - 0
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.

+ 4 - 0
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

+ 6 - 0
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