You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/17 08:26:02 UTC

[49/50] incubator-weex git commit: Revert "* [test] vilid protect for danger ci"

Revert "* [test] vilid protect for danger ci"

This reverts commit 4326a6fcaaf4797e6e675cb60dd43ac985897cc9.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f5fbd4e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f5fbd4e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f5fbd4e2

Branch: refs/heads/release-0.16
Commit: f5fbd4e20a521eb1b61e3fdee2ee04d1262f098d
Parents: 4326a6f
Author: gurisxie <27...@qq.com>
Authored: Tue Oct 17 16:06:12 2017 +0800
Committer: gurisxie <27...@qq.com>
Committed: Tue Oct 17 16:06:12 2017 +0800

----------------------------------------------------------------------
 dangerfile.js | 36 ++++++++++++++----------------------
 1 file changed, 14 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f5fbd4e2/dangerfile.js
----------------------------------------------------------------------
diff --git a/dangerfile.js b/dangerfile.js
index 23da68a..83a0ef1 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -320,7 +320,6 @@ function findReviewer(resolve, reject) {
       resolve()
       return
     }
-    console.log('result:'+result);
     parseDeleteAndNormalLines(result.data, fileToDeletedLinesMap, fileToNormalLinesMap)
     console.log('getContent')
     var promises = danger.git.modified_files.map(function(file) {
@@ -375,29 +374,22 @@ function getContent(url) {
 
 function parseDeleteAndNormalLines(diffData, fileToDeletedLinesMap, fileToNormalLinesMap) {
   try {
-    console.log('parseDeleteAndNormalLines')
+    console.log('diffData:'+diffData)
     var diffs = parseDiff(diffData)
-    console.log('diffs:'+diffs)
-    if(diffs&&diffs instanceof Array){
-      diffs.forEach(diff => {
-        fileToDeletedLinesMap[diff.from] = [];
-        fileToNormalLinesMap[diff.from] = [];
-        if(diff&&diff.chunks&&diff.chunks instanceof Array){
-          diff.chunks.forEach(chunk => {
-            if(chunk&&chunk.changes&&chunk.changes instanceof Array){
-              chunk.changes.forEach(change => {
-                if (change&&change.del) {
-                  fileToDeletedLinesMap[diff.from].push(change.ln)
-                }
-                if (change&&change.normal) {
-                  fileToNormalLinesMap[diff.from].push(change.ln1)
-                }
-              })
-            }
-          })
-        }
+    diffs.forEach(diff => {
+      fileToDeletedLinesMap[diff.from] = [];
+      fileToNormalLinesMap[diff.from] = [];
+      diff.chunks.forEach(chunk => {
+        chunk.changes.forEach(change => {
+          if (change.del) {
+            fileToDeletedLinesMap[diff.from].push(change.ln)
+          }
+          if (change.normal) {
+            fileToNormalLinesMap[diff.from].push(change.ln1)
+          }
+        })
       })
-    }
+    })
   } catch (error) {
     console.log(error)
   }