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/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/12532050 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/12532050 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/12532050 Branch: refs/heads/master Commit: 12532050e56177a70a94a6d76645928cbd4826ce Parents: 90b8e66 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/yetus/blob/12532050/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/yetus/blob/12532050/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
