Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
Browse files Browse the repository at this point in the history
…ssLoaderAdapter.java
  • Loading branch information
wrmswindmill committed Jul 21, 2019
1 parent 82c5bb6 commit eed9cc4
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions dangerfile-static-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,45 @@ const type_c = 1;
const type_android = 2;

const getFileType = file => {
if (file.match(/.+\.(m|h|mm|cpp|cc)/)) {
return type_c;
} else if (file.match(/.+\.java/)) {
return type_android;
}else{
return type_unknown;
}
if (file.match(/.+\.(m|h|mm|cpp|cc)/)) {
return type_c;
} else if (file.match(/.+\.java/)) {
return type_android;
} else {
return type_unknown;
}
}

var hasCFile = false;
var hasAndroidFile = false;

function check(file_type){
function check(file_type) {
var has_file_type = false;
if (!has_file_type && danger.git.created_files) {
danger.git.created_files.some(file => {
var f = (getFileType(file)==file_type)
if(f){
has_file_type =f;
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
}

if (!has_file_type && danger.git.modified_files) {
danger.git.created_files.some(file => {
var f = (getFileType(file)==file_type)
if(f){
has_file_type =f;
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
}

if (!has_file_type && danger.git.deleted_files) {
danger.git.created_files.some(file => {
var f = (getFileType(file)==file_type)
if(f){
has_file_type =f;
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
Expand All @@ -79,10 +79,12 @@ hasCFile = check(type_c)
hasAndroidFile = check(type_android)

var output_str = ""
if(hasCFile){
if (hasCFile) {
output_str += 'hasCFile\n'
}
if(hasAndroidFile){
if (hasAndroidFile) {
output_str += 'hasAndroidFile\n'
}
console.log(output_str)


0 comments on commit eed9cc4

Please sign in to comment.