Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 a32b5b01b -> e7230d1ad


HADOOP-12301. Fix some test-patch plugins to count the diff lines correctly 
(Kengo Seki via aw)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e7230d1a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e7230d1a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e7230d1a

Branch: refs/heads/HADOOP-12111
Commit: e7230d1ad7f3f2166c05dce88a8338d77bcd6919
Parents: a32b5b0
Author: Allen Wittenauer <[email protected]>
Authored: Tue Aug 25 09:16:59 2015 -0700
Committer: Allen Wittenauer <[email protected]>
Committed: Tue Aug 25 09:16:59 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.d/pylint.sh  | 6 +++---
 dev-support/test-patch.d/rubocop.sh | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7230d1a/dev-support/test-patch.d/pylint.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/pylint.sh 
b/dev-support/test-patch.d/pylint.sh
index 1ee5a8f..6fa576e 100755
--- a/dev-support/test-patch.d/pylint.sh
+++ b/dev-support/test-patch.d/pylint.sh
@@ -148,14 +148,14 @@ function pylint_postapply
   add_footer_table pylint "v${PYLINT_VERSION%,}"
 
   calcdiffs "${PATCH_DIR}/branch-pylint-result.txt" 
"${PATCH_DIR}/patch-pylint-result.txt" > "${PATCH_DIR}/diff-patch-pylint.txt"
-  diffPostpatch=$(${AWK} 'BEGIN {sum=0} 2<NF {sum+=1} END {print sum}' 
"${PATCH_DIR}/diff-patch-pylint.txt")
+  diffPostpatch=$(${GREP} -c "^.*:.*: \[.*\] " 
"${PATCH_DIR}/diff-patch-pylint.txt")
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
     # shellcheck disable=SC2016
-    numPrepatch=$(${AWK} 'BEGIN {sum=0} 2<NF {sum+=1} END {print sum}' 
"${PATCH_DIR}/branch-pylint-result.txt")
+    numPrepatch=$(${GREP} -c "^.*:.*: \[.*\] " 
"${PATCH_DIR}/branch-pylint-result.txt")
 
     # shellcheck disable=SC2016
-    numPostpatch=$(${AWK} 'BEGIN {sum=0} 2<NF {sum+=1} END {print sum}' 
"${PATCH_DIR}/patch-pylint-result.txt")
+    numPostpatch=$(${GREP} -c "^.*:.*: \[.*\] " 
"${PATCH_DIR}/patch-pylint-result.txt")
 
     add_vote_table -1 pylint "The applied patch generated "\
       "${diffPostpatch} new pylint issues (total was ${numPrepatch}, now 
${numPostpatch})."

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7230d1a/dev-support/test-patch.d/rubocop.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/rubocop.sh 
b/dev-support/test-patch.d/rubocop.sh
index ba9810e..091a2b1 100755
--- a/dev-support/test-patch.d/rubocop.sh
+++ b/dev-support/test-patch.d/rubocop.sh
@@ -70,7 +70,7 @@ function rubocop_preapply
   pushd "${BASEDIR}" >/dev/null
   for i in ${CHANGED_FILES}; do
     if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
-      ${RUBOCOP} -f c "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> 
"${PATCH_DIR}/branch-rubocop-result.txt"
+      ${RUBOCOP} -f e "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> 
"${PATCH_DIR}/branch-rubocop-result.txt"
     fi
   done
   popd >/dev/null
@@ -110,7 +110,7 @@ function rubocop_postapply
   pushd "${BASEDIR}" >/dev/null
   for i in ${CHANGED_FILES}; do
     if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
-      ${RUBOCOP} -f c "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> 
"${PATCH_DIR}/patch-rubocop-result.txt"
+      ${RUBOCOP} -f e "${i}" | ${AWK} '!/[0-9]* files? inspected/' >> 
"${PATCH_DIR}/patch-rubocop-result.txt"
     fi
   done
   popd >/dev/null

Reply via email to