Return-Path: X-Original-To: apmail-yetus-commits-archive@minotaur.apache.org Delivered-To: apmail-yetus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43B70181BB for ; Tue, 8 Dec 2015 02:06:36 +0000 (UTC) Received: (qmail 33198 invoked by uid 500); 8 Dec 2015 02:06:36 -0000 Delivered-To: apmail-yetus-commits-archive@yetus.apache.org Received: (qmail 33180 invoked by uid 500); 8 Dec 2015 02:06:36 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 33169 invoked by uid 99); 8 Dec 2015 02:06:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2015 02:06:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0579DE0A02; Tue, 8 Dec 2015 02:06:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sekikn@apache.org To: commits@yetus.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: yetus git commit: YETUS-219. pylint plugin displays grep error message if patch contains modification to python and other files. Date: Tue, 8 Dec 2015 02:06:36 +0000 (UTC) Repository: yetus Updated Branches: refs/heads/master 201a3782a -> 76653b4a2 YETUS-219. pylint plugin displays grep error message if patch contains modification to python and other files. Signed-off-by: Kengo Seki Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/76653b4a Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/76653b4a Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/76653b4a Branch: refs/heads/master Commit: 76653b4a2e7316d774adf4f401821f4f15d3f643 Parents: 201a378 Author: Marco Zuehlke Authored: Mon Dec 7 18:07:33 2015 +0100 Committer: Kengo Seki Committed: Tue Dec 8 11:04:32 2015 +0900 ---------------------------------------------------------------------- precommit/test-patch.d/pylint.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/76653b4a/precommit/test-patch.d/pylint.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/pylint.sh b/precommit/test-patch.d/pylint.sh index 7ae9454..f97a140 100755 --- a/precommit/test-patch.d/pylint.sh +++ b/precommit/test-patch.d/pylint.sh @@ -57,7 +57,7 @@ function pylint_preapply { local i local count - local tmp=pylint.$$.${RANDOM} + local pylintStderr=branch-pylint-stderr.txt verify_needed_test pylint if [[ $? == 0 ]]; then @@ -79,16 +79,17 @@ function pylint_preapply if [[ ${i} =~ \.py$ && -f ${i} ]]; then # shellcheck disable=SC2086 eval "${PYLINT} ${PYLINT_OPTIONS} --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --reports=n ${i}" \ - 2>${PATCH_DIR}/${tmp} | ${AWK} '1> "${PATCH_DIR}/branch-pylint-result.txt" + 2>>${PATCH_DIR}/${pylintStderr} | ${AWK} '1> "${PATCH_DIR}/branch-pylint-result.txt" fi - # shellcheck disable=SC2016 - count=$(${GREP} -v "^No config file found" "${PATCH_DIR}/${tmp}" | wc -l | ${AWK} '{print $1}') + done + if [[ -f ${PATCH_DIR}/${pylintStderr} ]]; then + count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}") if [[ ${count} -gt 0 ]]; then - add_footer_table pylint "prepatch stderr: @@BASE@@/${tmp}" + add_footer_table pylint "prepatch stderr: @@BASE@@/${pylintStderr}" return 1 fi - done - rm "${PATCH_DIR}/${tmp}" 2>/dev/null + fi + rm "${PATCH_DIR}/${pylintStderr}" 2>/dev/null popd >/dev/null # keep track of how much as elapsed for us already PYLINT_TIMER=$(stop_clock) @@ -102,7 +103,7 @@ function pylint_postapply local numPrepatch local numPostpatch local diffPostpatch - local tmp=pylint.$$.${RANDOM} + local pylintStderr=patch-pylint-stderr.txt verify_needed_test pylint if [[ $? == 0 ]]; then @@ -130,17 +131,18 @@ function pylint_postapply if [[ ${i} =~ \.py$ && -f ${i} ]]; then # shellcheck disable=SC2086 eval "${PYLINT} ${PYLINT_OPTIONS} --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --reports=n ${i}" \ - 2>${PATCH_DIR}/${tmp} | ${AWK} '1> "${PATCH_DIR}/patch-pylint-result.txt" + 2>>${PATCH_DIR}/${pylintStderr} | ${AWK} '1> "${PATCH_DIR}/patch-pylint-result.txt" fi - # shellcheck disable=SC2016 - count=$(${GREP} -v "^No config file found" "${PATCH_DIR}/${tmp}" | wc -l | ${AWK} '{print $1}') + done + if [[ -f ${PATCH_DIR}/${pylintStderr} ]]; then + count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}") if [[ ${count} -gt 0 ]]; then add_vote_table -1 pylint "Something bad seems to have happened in running pylint. Please check pylint stderr files." - add_footer_table pylint "postpatch stderr: @@BASE@@/${tmp}" + add_footer_table pylint "postpatch stderr: @@BASE@@/${pylintStderr}" return 1 fi - done - rm "${PATCH_DIR}/${tmp}" 2>/dev/null + fi + rm "${PATCH_DIR}/${pylintStderr}" 2>/dev/null popd >/dev/null # shellcheck disable=SC2016