Repository: yetus Updated Branches: refs/heads/master 38e69e9e9 -> 35b85a9a3
YETUS-210. Link to pylint stderr file is invalid on Jenkins Signed-off-by: Allen Wittenauer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/35b85a9a Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/35b85a9a Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/35b85a9a Branch: refs/heads/master Commit: 35b85a9a33d8102550107081f97e6ba3a9f47336 Parents: 38e69e9 Author: Kengo Seki <[email protected]> Authored: Sat Nov 28 00:28:26 2015 +0900 Committer: Allen Wittenauer <[email protected]> Committed: Mon Nov 30 20:51:59 2015 -0800 ---------------------------------------------------------------------- precommit/test-patch.d/pylint.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/35b85a9a/precommit/test-patch.d/pylint.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/pylint.sh b/precommit/test-patch.d/pylint.sh index d5af000..7ae9454 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=${PATCH_DIR}/pylint.$$.${RANDOM} + local tmp=pylint.$$.${RANDOM} verify_needed_test pylint if [[ $? == 0 ]]; then @@ -78,17 +78,17 @@ function pylint_preapply for i in ${CHANGED_FILES}; do if [[ ${i} =~ \.py$ && -f ${i} ]]; then # shellcheck disable=SC2086 - eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n ${i}" 2>${tmp} | - ${AWK} '1<NR' >> "${PATCH_DIR}/branch-pylint-result.txt" + eval "${PYLINT} ${PYLINT_OPTIONS} --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --reports=n ${i}" \ + 2>${PATCH_DIR}/${tmp} | ${AWK} '1<NR' >> "${PATCH_DIR}/branch-pylint-result.txt" fi # shellcheck disable=SC2016 - count=$(${GREP} -v "^No config file found" "${tmp}" | wc -l | ${AWK} '{print $1}') + count=$(${GREP} -v "^No config file found" "${PATCH_DIR}/${tmp}" | wc -l | ${AWK} '{print $1}') if [[ ${count} -gt 0 ]]; then - add_footer_table pylint "prepatch stderr: ${tmp}" + add_footer_table pylint "prepatch stderr: @@BASE@@/${tmp}" return 1 fi done - rm "${tmp}" 2>/dev/null + rm "${PATCH_DIR}/${tmp}" 2>/dev/null popd >/dev/null # keep track of how much as elapsed for us already PYLINT_TIMER=$(stop_clock) @@ -102,7 +102,7 @@ function pylint_postapply local numPrepatch local numPostpatch local diffPostpatch - local tmp=${PATCH_DIR}/pylint.$$.${RANDOM} + local tmp=pylint.$$.${RANDOM} verify_needed_test pylint if [[ $? == 0 ]]; then @@ -129,18 +129,18 @@ function pylint_postapply for i in ${CHANGED_FILES}; do if [[ ${i} =~ \.py$ && -f ${i} ]]; then # shellcheck disable=SC2086 - eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n ${i}" 2>${tmp} | - ${AWK} '1<NR' >> "${PATCH_DIR}/patch-pylint-result.txt" + eval "${PYLINT} ${PYLINT_OPTIONS} --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --reports=n ${i}" \ + 2>${PATCH_DIR}/${tmp} | ${AWK} '1<NR' >> "${PATCH_DIR}/patch-pylint-result.txt" fi # shellcheck disable=SC2016 - count=$(${GREP} -v "^No config file found" "${tmp}" | wc -l | ${AWK} '{print $1}') + count=$(${GREP} -v "^No config file found" "${PATCH_DIR}/${tmp}" | wc -l | ${AWK} '{print $1}') 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: ${tmp}" + add_footer_table pylint "postpatch stderr: @@BASE@@/${tmp}" return 1 fi done - rm "${tmp}" 2>/dev/null + rm "${PATCH_DIR}/${tmp}" 2>/dev/null popd >/dev/null # shellcheck disable=SC2016
