Skip to content

Commit

Permalink
fix compare-with-develop-style script
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Apr 8, 2014
1 parent 468f6e6 commit 3590d72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ task generateWPConfig(group: "generate", description: "Generate Config class") {
package org.wordpress.android;
public final class Config {
${config}
}
""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void onClick(View v) {
if (mSelfHosted && !TextUtils.isEmpty(EditTextUtils.getText(mUrlEditText).trim())) {
baseUrl = EditTextUtils.getText(mUrlEditText).trim();
String lowerCaseBaseUrl = baseUrl.toLowerCase(Locale.getDefault());
if (!lowerCaseBaseUrl.startsWith("https://")&& !lowerCaseBaseUrl.startsWith("http://")) {
if (!lowerCaseBaseUrl.startsWith("https://") && !lowerCaseBaseUrl.startsWith("http://")) {
baseUrl = "http://" + baseUrl;
}
}
Expand Down
14 changes: 7 additions & 7 deletions tools/compare-with-develop-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)
current_branch_filtered=$(echo $current_branch | tr "/" "-")

# save local changes if any
git stash | grep "No local changes to save" > /dev/null
needpop=$?

modified_files=$(git --no-pager diff develop --name-only)
modified_files=$(git --no-pager diff develop --name-only | grep ".java$")

# Check style on current branch
checkstyle -c ../cq-configs/checkstyle/checkstyle.xml $modified_files > /tmp/checkstyle-$current_branch_filtered.log
checkstyle -c cq-configs/checkstyle/checkstyle.xml $modified_files > /tmp/checkstyle-$current_branch_filtered.log

# Check style on current develop
git stash | grep "No local changes to save" > /dev/null
needpop=$?
git checkout $compared_branch
checkstyle -c ../cq-configs/checkstyle/checkstyle.xml $modified_files > /tmp/checkstyle-develop.log
checkstyle -c cq-configs/checkstyle/checkstyle.xml $modified_files > /tmp/checkstyle-develop.log

# Back on current branch
git checkout $current_branch

echo
echo --------------------------
echo The following warnings seem to be introduced by your branch:
diff -u /tmp/checkstyle-$current_branch_filtered.log \
/tmp/checkstyle-develop.log | grep "^+" | grep -v "^+++"
diff -u /tmp/checkstyle-develop.log /tmp/checkstyle-$current_branch_filtered.log | grep "^+" | grep -v "^+++"

# restore local changes
if [ $needpop -eq 1 ]; then
Expand Down

0 comments on commit 3590d72

Please sign in to comment.