From 7b7c2918f9bcc4663539288eedb0a1fa8ce125dd Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Fri, 19 May 2023 16:03:24 +0100 Subject: [PATCH] fix: RC010 should ignore components without parameters (#210) This fixes #209 --- src/scripts/review.bats | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scripts/review.bats b/src/scripts/review.bats index b7f7d69..69b6ae9 100644 --- a/src/scripts/review.bats +++ b/src/scripts/review.bats @@ -201,6 +201,13 @@ setup() { echo "Component names should be snake_cased. Please rename this file to use snake_case." exit 1 fi + + # Check if the file has parameters, if not skip counting. + HAS_PARAMETERS=$(yq 'has("parameters")' "$i") + if [[ "$HAS_PARAMETERS" == "false" ]]; then + continue + fi + # Check parameter keys on component for snake_case ORB_COMPONENT_PARAMETERS_COUNT=$(yq '.parameters | keys | .[]' "$i") for j in $ORB_COMPONENT_PARAMETERS_COUNT; do