Improved whitelisting by splitting ignores by newline instead of spaces only @urjitbhatia

Split ignores by newline instead of spaces only
This commit is contained in:
Toni de la Fuente
2020-05-29 11:40:44 +02:00
committed by GitHub

View File

@@ -111,19 +111,19 @@ textFail(){
## ignore whitelists for current check ## ignore whitelists for current check
level="FAIL" level="FAIL"
colorcode="$BAD" colorcode="$BAD"
for i in $IGNORES; do while read -r i; do
ignore_check_name="${i%:*}" ignore_check_name="${i%:*}"
ignore_value="${i#*${CHECK_NAME}:}" ignore_value="${i#*${CHECK_NAME}:}"
if [[ ${ignore_check_name} != "${CHECK_NAME}" ]]; then if [[ ${ignore_check_name} != "${CHECK_NAME}" ]]; then
# not for this check # not for this check
continue continue
fi fi
if [[ $1 =~ ${ignore_value} ]]; then if [[ $1 =~ .*"${ignore_value}".* ]]; then
level="WARNING" level="WARNING"
colorcode="$WARNING" colorcode="$WARNING"
break break
fi fi
done done <<< "$IGNORES"
# only set non-0 exit code on FAIL mode, WARN is ok # only set non-0 exit code on FAIL mode, WARN is ok
if [[ "$level" == "FAIL" ]]; then if [[ "$level" == "FAIL" ]]; then