You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@yetus.apache.org by aw...@apache.org on 2022/05/04 14:33:18 UTC

[yetus] branch main updated: YETUS-1176. linecomments_end should always execute (#275)

This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new 63394467 YETUS-1176. linecomments_end should always execute (#275)
63394467 is described below

commit 63394467fe061298e55594d6f16c5cd63a0e5c8f
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Wed May 4 07:33:13 2022 -0700

    YETUS-1176. linecomments_end should always execute (#275)
    
    Signed-off-by: Nick Dimiduk <nd...@apache.org>
---
 precommit/src/main/shell/core.d/linecomments.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/precommit/src/main/shell/core.d/linecomments.sh b/precommit/src/main/shell/core.d/linecomments.sh
index 130d68e3..1dc83f87 100755
--- a/precommit/src/main/shell/core.d/linecomments.sh
+++ b/precommit/src/main/shell/core.d/linecomments.sh
@@ -96,14 +96,14 @@ function bugsystem_linecomments_trigger
   declare text
   declare column
 
-  if [[ ! -f "${PATCH_DIR}/results-full.txt" ]]; then
-    return 0
+  if [[ -f "${PATCH_DIR}/results-full.txt" ]]; then
+    # sort the file such that all files and lines are now next to each other
+    sort -k1,1 -k2,2n -k3,3n -k4,4 "${PATCH_DIR}/results-full.txt" > "${PATCH_DIR}/linecomments-sorted.txt"
+    mv "${PATCH_DIR}/linecomments-sorted.txt" "${PATCH_DIR}/results-full.txt"
+  else
+    touch "${PATCH_DIR}/results-full.txt"
   fi
 
-  # sort the file such that all files and lines are now next to each other
-  sort -k1,1 -k2,2n -k3,3n -k4,4 "${PATCH_DIR}/results-full.txt" > "${PATCH_DIR}/linecomments-sorted.txt"
-  mv "${PATCH_DIR}/linecomments-sorted.txt" "${PATCH_DIR}/results-full.txt"
-
   while read -r line;do
     fn=${line%%:*}
     fn=${fn#./}  # strip off any leading ./