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 Commit: f5fbd4e20a521eb1b61e3fdee2ee04d1262f098d Parents: 4326a6f Author: gurisxie <279483...@qq.com> Authored: Tue Oct 17 16:06:12 2017 +0800 Committer: gurisxie <279483...@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) }