From 5b7253c1fff2f4c965e2ba09de915a765fe185c9 Mon Sep 17 00:00:00 2001 From: cschantz Date: Fri, 9 Jan 2026 18:12:47 -0500 Subject: [PATCH] Fix HARDCODED-PATH check for array elements Skip array element lines that are part of multi-panel path arrays Checks previous 10 lines for array declaration pattern --- tools/toolkit-qa-check.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/toolkit-qa-check.sh b/tools/toolkit-qa-check.sh index a398ab8..e789fed 100755 --- a/tools/toolkit-qa-check.sh +++ b/tools/toolkit-qa-check.sh @@ -2964,6 +2964,15 @@ while IFS=: read -r file line_num line_content; do # Skip array definitions (multi-panel path lists) echo "$line_content" | grep -qE '^\s*[a-zA-Z_]+=\(' && continue + # Skip array element lines (e.g., "/path/..." inside arrays) + # Check if previous lines have array declaration + if echo "$line_content" | grep -qE '^\s*"(/var|/home|/usr)'; then + context=$(sed -n "$((line_num - 10)),${line_num}p" "$file" 2>/dev/null) + if echo "$context" | grep -qE '[a-zA-Z_]+=\('; then + continue + fi + fi + # Extract the hardcoded path path=$(echo "$line_content" | grep -oE '(/var/cpanel|/var/log/apache2/domlogs|/home/[^/]*/public_html)' | head -1)