You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aw...@apache.org on 2020/02/18 22:55:29 UTC

[yetus] branch master updated: YETUS-939. shellcheck plugin's exclusion support is broken (#89)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7f1243a  YETUS-939. shellcheck plugin's exclusion support is broken (#89)
7f1243a is described below

commit 7f1243afb1c3e5e01474458c6097c04996a34533
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Tue Feb 18 14:55:21 2020 -0800

    YETUS-939. shellcheck plugin's exclusion support is broken (#89)
    
    Signed-off-by: Sean Busbey <bu...@apache.org>
---
 precommit/src/main/shell/test-patch.d/shellcheck.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/precommit/src/main/shell/test-patch.d/shellcheck.sh b/precommit/src/main/shell/test-patch.d/shellcheck.sh
index 099380b..729494a 100755
--- a/precommit/src/main/shell/test-patch.d/shellcheck.sh
+++ b/precommit/src/main/shell/test-patch.d/shellcheck.sh
@@ -99,12 +99,22 @@ function shellcheck_criteria
 {
   declare fn=$1
   declare text
+  declare excludepath
 
   if [[ ! -f "${fn}" ]]; then
     yetus_debug "Shellcheck rejected (not exist): ${fn}"
     return
   fi
 
+  # EXLUDE_PATHS should already be initialized by now, since
+  # we're in _precheck by the time this gets called
+
+  for excludepath in "${EXCLUDE_PATHS[@]}"; do
+    if [[  "${fn}" =~ ${excludepath} ]]; then
+      return
+    fi
+  done
+
   text=$(head -n 1 "${fn}")
 
   # shell check requires either a bangpath or a shellcheck directive