Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/202239

Change subject: [jscs] Enforce requireCapitalizedConstructors
......................................................................

[jscs] Enforce requireCapitalizedConstructors

 * Maybe the tokenizer patching should just be pushed the fork.

Change-Id: I4d75f03750f46418f4a8947024a5de6d7cd0531c
---
M .jscsrc
M lib/mediawiki.tokenizer.peg.js
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/39/202239/1

diff --git a/.jscsrc b/.jscsrc
index a044e78..046678e 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -10,7 +10,6 @@
        "maximumLineLength": null,
        "requireCamelCaseOrUpperCaseIdentifiers": null,
        "requireCapitalizedComments": null,
-       "requireCapitalizedConstructors": null,
        "requireCurlyBraces": [
                "if",
                "else",
diff --git a/lib/mediawiki.tokenizer.peg.js b/lib/mediawiki.tokenizer.peg.js
index 5971bee..3ed3391 100644
--- a/lib/mediawiki.tokenizer.peg.js
+++ b/lib/mediawiki.tokenizer.peg.js
@@ -92,7 +92,11 @@
                // Optionally save & require the tokenizer source
                tokenizerSource = tokenizerSource
                        .replace(/peg\$subclass\(child, parent\) {/g, 
function(m) {
-                               return m + "\n    /*jshint validthis:true, 
newcap:false */";
+                               return m + "\n    /* jshint validthis:true, 
newcap:false */" +
+                               "\n    /* jscs:disable 
requireCapitalizedConstructors */";
+                       })
+                       .replace(/new ctor\(\);/, function(m) {
+                               return m + "\n    /* jscs:enable 
requireCapitalizedConstructors */";
                        });
                tokenizerSource =
                        '/* jshint loopfunc:true, latedef:false, 
nonstandard:true, -W100 */\n' +

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d75f03750f46418f4a8947024a5de6d7cd0531c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

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

Reply via email to