You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/06 06:57:50 UTC

incubator-weex git commit: * [all] fix danger: use schedule to run async

Repository: incubator-weex
Updated Branches:
  refs/heads/0.14-dev d3a1e1de0 -> 0218e912f


* [all] fix danger: use schedule to run async


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

Branch: refs/heads/0.14-dev
Commit: 0218e912ff3df8b6e42bc55944d436c6036ed911
Parents: d3a1e1d
Author: sospartan <so...@apache.org>
Authored: Tue Jun 6 14:51:33 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Tue Jun 6 14:57:30 2017 +0800

----------------------------------------------------------------------
 dangerfile.js | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0218e912/dangerfile.js
----------------------------------------------------------------------
diff --git a/dangerfile.js b/dangerfile.js
index 58444e0..d78db5e 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -93,6 +93,21 @@ function is_ignored_public_check(file) {
   return false;
 }
 
+async function checkBreakChange(file){
+  var diff = await danger.git.diffForFile(file);
+  if (diff && diff.removed && diff.removed.match(/^-\s*?public\s+[\s\S]+$/gm)) {
+    if (methion_break_change) {
+      warn("Potential BREAK CHANGE. Modify public in   " + file);
+    } else {
+      warn(
+        "Potential BREAK CHANGE. Modify public in " +
+          file +
+          " without metion it in commit message. You'd better add 'break change' in your commit log. "
+      );
+    }
+  }
+}
+
 var has_app_changes = false;
 var has_test_changes = false;
 var codefiles = [];
@@ -103,21 +118,11 @@ for (let file of danger.git.modified_files) {
     has_test_changes = true;
   }
 
-  /* diffforFile
-   * if (!is_ignored_public_check(file) && file.endsWith(".java")) {
-    var diff = await danger.git.diffForFile(file);
-    if (diff && diff.removed && diff.removed.match(/^-\s*?public\s+[\s\S]+$/gm)) {
-      if (methion_break_change) {
-        warn("Potential BREAK CHANGE. Modify public in   " + file);
-      } else {
-        warn(
-          "Potential BREAK CHANGE. Modify public in " +
-            file +
-            " without metion it in commit message. You'd better add 'break change' in your commit log. "
-        );
-      }
-    }
-  }*/
+  if (!is_ignored_public_check(file) && file.endsWith(".java")) {
+    schedule(async ()=> {
+      await checkBreakChange(file)
+    })
+  }
 
   if (
     file.endsWith(".h") ||