You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@yetus.apache.org by "Kengo Seki (JIRA)" <ji...@apache.org> on 2015/12/05 16:13:10 UTC
[jira] [Created] (YETUS-219) pylint plugin displays grep error
message if patch contains modification to python and other files
Kengo Seki created YETUS-219:
--------------------------------
Summary: pylint plugin displays grep error message if patch contains modification to python and other files
Key: YETUS-219
URL: https://issues.apache.org/jira/browse/YETUS-219
Project: Yetus
Issue Type: Bug
Components: Test Patch
Reporter: Kengo Seki
Priority: Minor
I tried YETUS-211.1.patch and got the following error:
{code}
[sekikn@localhost yetus]$ precommit/test-patch.sh --build-tool=nobuild --plugins=all --resetrepo YETUS-211
(snip)
============================================================================
============================================================================
pylint plugin: prepatch
============================================================================
============================================================================
Running pylint against modified python scripts.
grep: /tmp/yetus-6656.30892/pylint.20253.7393: No such file or directory
grep: /tmp/yetus-6656.30892/pylint.20253.7393: No such file or directory
grep: /tmp/yetus-6656.30892/pylint.20253.7393: No such file or directory
(snip)
============================================================================
============================================================================
pylint plugin: postpatch
============================================================================
============================================================================
Running pylint against modified python scripts.
grep: /tmp/yetus-6656.30892/pylint.20253.31981: No such file or directory
grep: /tmp/yetus-6656.30892/pylint.20253.31981: No such file or directory
grep: /tmp/yetus-6656.30892/pylint.20253.31981: No such file or directory
{code}
This is because stderr redirected file is always checked even if it doesn't exist. Lines 135-141 should be inside of lines 130-134.
{code:title=pylint.sh}
129 for i in ${CHANGED_FILES}; do
130 if [[ ${i} =~ \.py$ && -f ${i} ]]; then
131 # shellcheck disable=SC2086
132 eval "${PYLINT} ${PYLINT_OPTIONS} --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --reports=n ${i}" \
133 2>${PATCH_DIR}/${tmp} | ${AWK} '1<NR' >> "${PATCH_DIR}/patch-pylint-result.txt"
134 fi
135 # shellcheck disable=SC2016
136 count=$(${GREP} -v "^No config file found" "${PATCH_DIR}/${tmp}" | wc -l | ${AWK} '{print $1}')
137 if [[ ${count} -gt 0 ]]; then
138 add_vote_table -1 pylint "Something bad seems to have happened in running pylint. Please check pylint stderr files."
139 add_footer_table pylint "postpatch stderr: @@BASE@@/${tmp}"
140 return 1
141 fi
142 done
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)