jenkins-bot has submitted this change and it was merged.
Change subject: Pre-commit hook fixes
......................................................................
Pre-commit hook fixes
* Fix checkless and compile-lightncandy which were broken by a
MediaWiki-Vagrant change.
* Run jsduck on pre-commit to check for failures, and fix
a jsduck failure.
* Add docs (from jsduck) to tyops exclude
* Fix problem with jscs:fix
* Remove unused Labs-related code from Makefile
* Use grep -E (which is standard) rather than non-standard -P
(Perl-style) when we weren't using anything Perl-y anyway.
Fixes OS X (and I guess BSD...).
Change-Id: I03bfb2538f089f75e53e18da42468ee32ff1f276
---
M Gruntfile.js
M Makefile
M modules/flow/dm/mw.flow.dm.Content.js
M scripts/hooks-shared.sh
M scripts/pre-commit
5 files changed, 23 insertions(+), 31 deletions(-)
Approvals:
Sbisson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Gruntfile.js b/Gruntfile.js
index 62d6a54..40d9520 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -21,7 +21,7 @@
},
src: [
'**/*',
- '!{node_modules,vendor}/**',
+ '!{node_modules,vendor,docs}/**',
'!build/typos.json'
]
},
@@ -38,6 +38,7 @@
jscs: {
fix: {
options: {
+ config: true,
fix: true
},
src: '<%= jshint.all %>'
diff --git a/Makefile b/Makefile
index abcb640..14fdedf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,10 @@
MW_INSTALL_PATH ?= ../..
MEDIAWIKI_LOAD_URL ?= http://localhost:8080/w/load.php
+ifneq ("$(wildcard /vagrant)","")
+IS_VAGRANT = 1
+endif
+
# Flow files to analyze
ANALYZE=container.php Flow.php Resources.php includes/
@@ -12,18 +16,6 @@
# Make sure we use php5
PHP=`command -v php5 || command -v php`
-
-###
-# Labs maintenance
-###
-ee-flow:
- ssh ee-flow.eqiad.wmflabs 'cd /srv/mediawiki/extensions/Flow && make
master'
-ee-flow-extra:
- ssh ee-flow-extra.eqiad.wmflabs 'cd /vagrant/mediawiki/extensions/Flow
&& make master'
-# Used to be ee-flow-big, not so big any more
-ee-flow-extra2:
- ssh ee-flow-extra2.eqiad.wmflabs 'cd /srv/mediawiki/extensions/Flow &&
make master'
-update-labs: ee-flow ee-flow-extra ee-flow-extra2
###
# Meta stuff
@@ -60,7 +52,14 @@
@npm test
checkless:
+ifdef IS_VAGRANT
+ mwscript maintenance/checkLess.php --wiki=wiki
+else
@${PHP} ../../maintenance/checkLess.php
+endif
+
+jsduck:
+ jsduck
csscss: gems
echo "Generating CSS file..."
@@ -95,8 +94,11 @@
# Compile lightncandy templates
###
compile-lightncandy:
+ifdef IS_VAGRANT
+ mwscript extensions/Flow/maintenance/compileLightncandy.php --wiki=wiki
+else
@${PHP} maintenance/compileLightncandy.php
-
+endif
###
# Automatically rename/move files based on fully-qualified classname &
# compile class autoloader for $wgAutoloadClasses
@@ -111,14 +113,3 @@
###
gems:
bundle install
-
-master:
- git fetch
- @echo Here is what is new on origin/master:
- @git log HEAD..origin/master
- @echo Checkout and update master:
- git checkout master && git pull --ff-only
- @echo 'exit( ( $$wgFlowCluster === false && $$wgFlowDefaultWikiDb ===
false) ? 0 : 1 )' | php ../../maintenance/eval.php && echo Apply DB updates
\(if any\) && php $(MW_INSTALL_PATH)/maintenance/update.php --quick | sed -n
'/^[^.]/p' || echo DB updates must be applied manually.
- @echo TODO Update Parsoid and restart it\? Other extensions\?
- @echo Run some tests\!\!\!
-
diff --git a/modules/flow/dm/mw.flow.dm.Content.js
b/modules/flow/dm/mw.flow.dm.Content.js
index 3caf7d1..71e738b 100644
--- a/modules/flow/dm/mw.flow.dm.Content.js
+++ b/modules/flow/dm/mw.flow.dm.Content.js
@@ -9,8 +9,8 @@
* {
* content: "content in the default format",
* format: "name of the default format",
- * "<other format name 1>": "content in the specified
format"
- * "<other format name n>": "content in the specified
format"
+ * "(other format name 1)": "content in the specified
format"
+ * "(other format name n)": "content in the specified
format"
* }
*/
mw.flow.dm.Content = function mwFlowContent( representations ) {
diff --git a/scripts/hooks-shared.sh b/scripts/hooks-shared.sh
index f30c0eb..2903bcd 100644
--- a/scripts/hooks-shared.sh
+++ b/scripts/hooks-shared.sh
@@ -19,7 +19,7 @@
make() {
if is_vagrant; then
- echo 'git hooks: Attempting to ssh into vagrant'
+ echo 'git hooks: Attempting to ssh into Vagrant'
vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&' /bin/echo
'git hooks: Running commands inside Vagrant' '&&' sudo -u www-data make $* ||
exit 1
else
/usr/bin/env make $* || exit 1
@@ -27,7 +27,7 @@
}
list_files_changed_in_commit() {
- git diff --name-only --cached | grep -P "$1"
+ git diff --name-only --cached | grep -E "$1"
}
file_changed_in_commit() {
@@ -35,6 +35,6 @@
}
file_changed_in_head() {
- git diff-tree --no-commit-id --name-only -r HEAD | grep -P "$1" 2>&1
>/dev/null
+ git diff-tree --no-commit-id --name-only -r HEAD | grep -E "$1" 2>&1
>/dev/null
}
diff --git a/scripts/pre-commit b/scripts/pre-commit
index a984fc2..c0df78f 100755
--- a/scripts/pre-commit
+++ b/scripts/pre-commit
@@ -39,7 +39,7 @@
if file_changed_in_commit '\.js$'; then
if [ "$IGNORE_JSHINT" != "1" ]; then
- COMMANDS="grunt $COMMANDS"
+ COMMANDS="grunt jsduck $COMMANDS"
fi
fi
--
To view, visit https://gerrit.wikimedia.org/r/282400
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I03bfb2538f089f75e53e18da42468ee32ff1f276
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits