jenkins-bot has submitted this change and it was merged.

Change subject: pre-review script to run check-i18n and analyze-phpstorm when 
appropriate
......................................................................


pre-review script to run check-i18n and analyze-phpstorm when appropriate

Checks for changes in HEAD to .php and .i18n.php files. When they have
changed it will run check-i18n and analyze-phpstorm Makefile commands

Change-Id: I3be61aba460ae3d1837773a1e71d6c42a2de01cb
---
M Makefile
A scripts/pre-review
2 files changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Bsitu: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Makefile b/Makefile
index ad43ce0..04632ca 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@
 ###
 installhooks:
        ln -sf ${PWD}/scripts/pre-commit .git/hooks/pre-commit
+       ln -sf ${PWD}/scripts/pre-review .git/hooks/pre-review
 
 ###
 # Lints
diff --git a/scripts/pre-review b/scripts/pre-review
new file mode 100755
index 0000000..2504744
--- /dev/null
+++ b/scripts/pre-review
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Work out location of Flow/scripts/ directory
+dir=$(php -r "echo dirname( realpath( '$0' ) ), \"\\n\";")
+# Move to the project root
+cd $(dirname $dir)
+# Source the shared shell functions
+. $dir/hooks-shared.sh
+
+# only checks top commit for changes. havn't figured out how to get
+# git-review to tell us which commits are being submitted
+if file_changed_in_head '\.php$'; then
+       # bit of a hack ... other things run inside vagrant but phpstorm is 
probably
+       # installed external to vagrant
+       /usr/bin/env make analyze-phpstorm
+fi
+
+if file_changed_in_head '\.i18n\.php$'; then
+       COMMANDS="check-i18n $COMMANDS"
+fi
+
+if [ "$COMMANDS" != "" ]; then
+       make $COMMANDS || exit 1
+fi
+

-- 
To view, visit https://gerrit.wikimedia.org/r/114703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3be61aba460ae3d1837773a1e71d6c42a2de01cb
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Bsitu <bs...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to