Uploaded image for project: 'Yetus'
  1. Yetus
  2. YETUS-219

pylint plugin displays grep error message if patch contains modification to python and other files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.1.0
    • Precommit
    • None

    Description

      I tried YETUS-211.1.patch and got the following error:

      [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
      
      

      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.

      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
      

      Attachments

        1. YETUS-219.00.patch
          3 kB
          Marco Zühlke

        Activity

          People

            mzuehlke Marco Zühlke
            sekikn Kengo Seki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: