From 37b54db8247d6fb75721d53b6ad79c337a1fe9b3 Mon Sep 17 00:00:00 2001 From: reachableceo Date: Sat, 5 Sep 2026 07:17:22 -0500 Subject: [PATCH] [#769] framework fix: cn_count double-count in compose check https://projects.knownelement.com/issues/769 --- scripts/check-rules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-rules.sh b/scripts/check-rules.sh index 1d0c16d..8b7c476 100755 --- a/scripts/check-rules.sh +++ b/scripts/check-rules.sh @@ -87,7 +87,7 @@ if [ -n "$COMPOSE_FILES" ]; then # Count top-level service keys (2-space indent under services:) and # compare against the number of container_name: declarations. svc_count=$(awk '/^services:/{f=1;next} f&&/^[^[:space:]]/{f=0} f&&/^[[:space:]]{2}[[:alnum:]_-]+:[[:space:]]*$/{c++} END{print c+0}' "$cf") - cn_count=$(grep -cE '^[[:space:]]*container_name:' "$cf" 2>/dev/null || echo 0) + cn_count=$(grep -cE '^[[:space:]]*container_name:' "$cf" 2>/dev/null) if [ "${svc_count:-0}" -gt 0 ] && [ "$cn_count" -lt "$svc_count" ]; then BAD=$((BAD + 1)) fi