Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 5 additions & 44 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -153,3 +113,4 @@ jobs:

exit "$rc"
' sh < "$files_list"

Loading