jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398902 )

Change subject: Linter: Delete commented out / unused lints + mocha tests
......................................................................


Linter: Delete commented out / unused lints + mocha tests

Change-Id: Iac8460ac7a39c941d6ad560814a950b457d37c41
---
M lib/wt2html/pp/handlers/linter.js
M tests/mocha/linter.js
2 files changed, 0 insertions(+), 131 deletions(-)

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



diff --git a/lib/wt2html/pp/handlers/linter.js 
b/lib/wt2html/pp/handlers/linter.js
index db43032..ffa1079 100644
--- a/lib/wt2html/pp/handlers/linter.js
+++ b/lib/wt2html/pp/handlers/linter.js
@@ -73,33 +73,6 @@
        return tagsWithChangedMisnestingBehavior;
 }
 
-/*
- * Log Transclusion with more than one parts
- * Ex - {{table-start}}
- *      {{cell|unused value|key=used value}}
- *      |-
- *      {{cell|unused value|key=used value}}
- *      |-
- *      |<math>1+1</math>
- *      |}
- * 
https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Transclusion_content
- */
-/*
-function logTransclusions(env, node, dp, tplInfo) {
-       var parts = DU.getDataMw(node).parts;
-       if (!Array.isArray(parts) || parts.length < 2) { return; }
-
-       var type = 'multi-template';
-       parts.forEach(function(a) {
-               if (typeof a === 'string') {
-                       type = 'mixed-content';
-               }
-       });
-
-       env.log('lint/' + type, { dsr: tplInfo.dsr });
-}
-*/
-
 var getNextMatchingNode, leftMostDescendent;
 
 leftMostDescendent = function(node, match) {
@@ -393,62 +366,8 @@
                                }
                        }
                }
-
-               if (DU.hasLiteralHTMLMarker(dp) &&
-                       dp.autoInsertedStart === true &&
-                       (tplInfo ||  dsr[3] > 0)) {
-                       lintObj = {
-                               dsr: dsr,
-                               templateInfo: templateInfo,
-                       };
-                       env.log('lint/missing-start-tag', lintObj);
-               }
        }
 }
-
-/*
- * Log ignored table attributes.
- * This handles cases like:
- *
- * {|
- * |- foo
- * | bar
- * |}
- *
- * Here foo gets ignored and is found in the data-parsoid of <tr> tags.
- */
-
-/* ----------------------------------------------
- * Comment out this whole thing to satisfy eslint
- *
-function logIgnoredTableAttr(env, node, dp, tplInfo) {
-       if (!node.nodeName === 'TABLE') {
-               return;
-       }
-
-       var tbody = DU.firstNonSepChildNode(node);
-       var c = tbody.firstChild;
-       while (c) {
-               if (c.nodeName === 'TR') {
-                       dp = DU.getDataParsoid(c);
-                       if (dp.sa) {
-                               // Discard attributes that are only whitespace 
and comments
-                               for (var key in dp.sa) {
-                                       var re = 
/^\s*$|^<!--([^-]|-(?!->))*-->([ \t]|<!--([^-]|-(?!->))*-->)*$/;
-                                       if (!re.test(key) || 
!re.test(dp.sa[key])) {
-                                               // FIXME: This is incorrect.
-                                               // We need to check if the key 
is absent in dp.a / in the node's attribute
-                                               var templateInfo = 
findEnclosingTemplateName(env, tplInfo);
-                                               var lintObj = { dsr: 
findLintDSR(templateInfo, tplInfo, dp.dsr), templateInfo: templateInfo };
-                                               
env.log('lint/ignored-table-attr', lintObj);
-                                       }
-                               }
-                       }
-               }
-               c = c.nextSibling;
-       }
-}
-*/
 
 /*
  * Log fostered content marked by markFosteredContent.js
diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index d57e142..69f02ad 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -222,37 +222,6 @@
                });
        });
 
-       /*
-       describe('IGNORED TABLE ATTRIBUTES', function() {
-               it('should lint ignored table attributes correctly', function() 
{
-                       return parseWT('{|\n|- 
foo\n|bar\n|}').then(function(result) {
-                               result.should.have.length(1);
-                               result[0].should.have.a.property("type", 
"ignored-table-attr");
-                               result[0].dsr.should.deep.equal([ 3, 14, 6, 0 
]);
-                       });
-               });
-               it('should lint ignored table attributes found in transclusions 
correctly', function() {
-                       return parseWT('{{1x|\n{{{!}}\n{{!}}- foo\n{{!}} 
bar\n{{!}}}\n}}').then(function(result) {
-                               result.should.have.length(1);
-                               result[0].should.have.a.property("type", 
"ignored-table-attr");
-                               result[0].dsr.should.deep.equal([ 0, 43, null, 
null]);
-                               
result[0].should.have.a.property("templateInfo");
-                               
result[0].templateInfo.should.have.a.property("name", "Template:1x");
-                       });
-               });
-               it('should not lint whitespaces as ignored table attributes', 
function() {
-                       return expectEmptyResults('{|\n|- \n| 1 
||style="text-align:left;"| p \n|}');
-               });
-               it('should lint as ignored table attributes', function() {
-                       return parseWT('{|\n|- <!--bad 
attr-->attr\n|bar\n|}').then(function(result) {
-                               result.should.have.length(1);
-                               result[0].should.have.a.property("type", 
"ignored-table-attr");
-                               result[0].dsr.should.deep.equal([ 3, 30, 22, 0 
]);
-                       });
-               });
-       });
-       */
-
        describe('BOGUS IMAGE OPTIONS', function() {
                it('should lint Bogus image options correctly', function() {
                        return 
parseWT('[[file:a.jpg|foo|bar]]').then(function(result) {
@@ -328,25 +297,6 @@
                        });
                });
        });
-
-       /*
-       describe('MIXED-CONTENT TEMPLATES', function() {
-               it('should lint mixed-content templates', function() {
-                       return parseWT('{{1x|*}}hi').then(function(result) {
-                               result.should.have.length(1);
-                               result[0].should.have.a.property("type", 
"mixed-content");
-                               result[0].dsr.should.deep.equal([ 0, 10, null, 
null ]);
-                       });
-               });
-               it('should lint multi-template', function() {
-                       return 
parseWT('{{1x|*}}{{1x|hi}}').then(function(result) {
-                               result.should.have.length(1);
-                               result[0].should.have.a.property("type", 
"multi-template");
-                               result[0].dsr.should.deep.equal([ 0, 17, null, 
null ]);
-                       });
-               });
-       });
-       */
 
        describe('DELETABLE TABLE TAG', function() {
                it('should identify deletable table tag for T161341 (1)', 
function() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac8460ac7a39c941d6ad560814a950b457d37c41
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to