Skip to content

Commit

Permalink
* [test] add modify public method/class danger check
Browse files Browse the repository at this point in the history
  • Loading branch information
sospartan committed Mar 9, 2017
1 parent 18aa265 commit 2af15c1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
17 changes: 17 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Error or Warn when delete public interface
metion_break_change = git.commits.any? { |c| c.message =~ /'breack change'/ }

for file in git.modified_files do
if file.end_with?("java")
diff = git.diff_for_file(file)
if diff && diff.patch =~ /^-\s*?public\s+[\s\S]+$/
if metion_break_change
warn("Modify public in #{file}")
else
fail("Modify public in #{file} without metion it in commit message. ")
end
end
end



# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

Expand Down
6 changes: 4 additions & 2 deletions android/sdk/src/test/java/com/taobao/weex/TestActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@
package com.taobao.weex;

import android.app.Activity;

/**
* Created by sospartan on 7/27/16.
*/
public class TestActivity extends Activity {
public class TestActivity extends Activity {
public void test(){
//
}
}
2 changes: 1 addition & 1 deletion test/ci-funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function test_cpt {
npm run build
npm run test
else
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
# xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
bundle exec danger
fi
}
Expand Down

0 comments on commit 2af15c1

Please sign in to comment.