From 9ae20ca2733b626fb7789fc5496043fe0080b1f5 Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Thu, 4 Jun 2026 09:48:33 +0530 Subject: [PATCH] ci: keep ShellCheck SC2317 enabled for all shell files The previous workflow special-cased Runner/utils/functestlib.sh to ignore SC2317. The reported SC2317 issues were caused by duplicate helper entries rather than a required library lint exception. Remove the functestlib-specific SC2317 exclusion and keep ShellCheck strict for all shell files. Preserve the existing workflow behavior: changed shell files are linted on pull requests, while push/manual runs lint the full shell tree. Keep the PR branch hardening by passing github.base_ref through an environment variable and validating it with git check-ref-format before using it in git fetch. Signed-off-by: Srikanth Muppandam --- .github/workflows/shellcheck.yml | 49 ++++---------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 9bbd3400..da51942a 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -61,31 +61,11 @@ jobs: tr '\0' '\n' < "$files_list" xargs -0 -r sh -c ' - is_functestlib() { - lint_file_path="$1" - - case "$lint_file_path" in - ./Runner/utils/functestlib.sh|Runner/utils/functestlib.sh) - return 0 - ;; - esac - - return 1 - } - run_shellcheck() { lint_file_path="$1" - base_excludes="SC1091,SC2230,SC3043" - lint_excludes="$base_excludes" - - if is_functestlib "$lint_file_path"; then - lint_excludes="${base_excludes},SC2317" - echo "ShellCheck functestlib mode: $lint_file_path" - else - echo "ShellCheck strict mode: $lint_file_path" - fi - shellcheck -s sh -e "$lint_excludes" -- "$lint_file_path" + echo "ShellCheck strict mode: $lint_file_path" + shellcheck -s sh -e SC1091,SC2230,SC3043 -- "$lint_file_path" } rc=0 @@ -116,31 +96,11 @@ jobs: fi xargs -0 -r sh -c ' - is_functestlib() { - lint_file_path="$1" - - case "$lint_file_path" in - ./Runner/utils/functestlib.sh|Runner/utils/functestlib.sh) - return 0 - ;; - esac - - return 1 - } - run_shellcheck() { lint_file_path="$1" - base_excludes="SC1091,SC2230,SC3043" - lint_excludes="$base_excludes" - - if is_functestlib "$lint_file_path"; then - lint_excludes="${base_excludes},SC2317" - echo "ShellCheck functestlib mode: $lint_file_path" - else - echo "ShellCheck strict mode: $lint_file_path" - fi - shellcheck -s sh -e "$lint_excludes" -- "$lint_file_path" + echo "ShellCheck strict mode: $lint_file_path" + shellcheck -s sh -e SC1091,SC2230,SC3043 -- "$lint_file_path" } rc=0 @@ -153,3 +113,4 @@ jobs: exit "$rc" ' sh < "$files_list" +