From 21b6f5061392bc3d63e7b329d52a28fa9bfe8d5f Mon Sep 17 00:00:00 2001 From: reachableceo Date: Thu, 30 Jul 2026 13:00:58 -0500 Subject: [PATCH] fix(demo): make validation suite runnable and shellcheck-clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit validate-all.sh aborted after the very first check because its post-increment counters (`((VAR++))`) return exit status 1 when the old value is 0, and `set -e` terminated the script. Use arithmetic assignment so the suite runs to completion. Add a .shellcheckrc to suppress the SC1090/SC1091 warnings that are inherent to the environment-driven design (dynamic `source` of demo.env), and drop an unused variable in demo-test.sh, so every script passes shellcheck cleanly. 💘 Generated with Crush Assisted-by: Crush:glm-5.2 --- demo/.shellcheckrc | 5 +++++ demo/scripts/demo-test.sh | 2 +- demo/scripts/validate-all.sh | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 demo/.shellcheckrc diff --git a/demo/.shellcheckrc b/demo/.shellcheckrc new file mode 100644 index 0000000..b988374 --- /dev/null +++ b/demo/.shellcheckrc @@ -0,0 +1,5 @@ +# ShellCheck configuration for the TSYS Developer Support Stack +# These rules are inherent to the environment-driven (dynamic source) design: +# SC1090 - can't follow non-constant source (e.g. `source "$ENV_FILE"`) +# SC1091 - not following external file specified as input (demo.env) +disable=SC1090,SC1091 diff --git a/demo/scripts/demo-test.sh b/demo/scripts/demo-test.sh index a9ee803..68f8e19 100755 --- a/demo/scripts/demo-test.sh +++ b/demo/scripts/demo-test.sh @@ -74,7 +74,7 @@ test_service_health() { log_test "Service health" local unhealthy=0 while IFS= read -r line; do - local name status + local name name=$(echo "$line" | awk '{print $1}') [[ "$name" == "NAMES" || -z "$name" ]] && continue if echo "$line" | grep -q "(healthy)"; then diff --git a/demo/scripts/validate-all.sh b/demo/scripts/validate-all.sh index e74e400..1b88003 100755 --- a/demo/scripts/validate-all.sh +++ b/demo/scripts/validate-all.sh @@ -17,8 +17,8 @@ BLUE='\033[0;34m' NC='\033[0m' log_validation() { echo -e "${BLUE}[VALIDATE]${NC} $1"; } -log_pass() { echo -e "${GREEN}[PASS]${NC} $1"; ((VALIDATION_PASSED++)); } -log_fail() { echo -e "${RED}[FAIL]${NC} $1"; ((VALIDATION_FAILED++)); } +log_pass() { echo -e "${GREEN}[PASS]${NC} $1"; VALIDATION_PASSED=$((VALIDATION_PASSED + 1)); } +log_fail() { echo -e "${RED}[FAIL]${NC} $1"; VALIDATION_FAILED=$((VALIDATION_FAILED + 1)); } validate_yaml_files() { log_validation "Validating YAML files with yamllint..."