Skip to content

Commit c7c122e

Browse files
committed
tools(shellcheck): SHELLCHECK_INSTALL_ONLY env to skip lint passes
Allows CI workflows that need only the platform-detected ShellCheck binary (reviewdog / action-suggester composers) to short-circuit after the cache is populated, instead of running the full source/board/lib linting passes they would have to discard. Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Igor Velkov <325961+iav@users.noreply.github.com>
1 parent 0fdb78f commit c7c122e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lib/tools/shellcheck.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ if [[ ! -f "${SHELLCHECK_BIN}" ]]; then
5252
echo "Down URL: ${DOWN_URL}"
5353
echo "SHELLCHECK_BIN: ${SHELLCHECK_BIN}"
5454
curl -fLo "${SHELLCHECK_BIN}.tar.xz" "${DOWN_URL}" || {
55-
echo "download of shellcheck failed from ${DOWN_URL}";
55+
echo "download of shellcheck failed from ${DOWN_URL}"
5656
rm -f "${SHELLCHECK_BIN}.tar.xz"
57-
exit 1;
57+
exit 1
5858
}
5959
tar -xf "${SHELLCHECK_BIN}.tar.xz" -C "${DIR_SHELLCHECK}" "shellcheck-v${SHELLCHECK_VERSION}/shellcheck"
6060
mv -v "${DIR_SHELLCHECK}/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" "${SHELLCHECK_BIN}"
@@ -63,6 +63,15 @@ if [[ ! -f "${SHELLCHECK_BIN}" ]]; then
6363
fi
6464
ACTUAL_VERSION="$("${SHELLCHECK_BIN}" --version | grep "^version")"
6565

66+
# Install-only mode: callers that just need the binary (CI workflows
67+
# composing reviewdog / action-suggester on top of the framework's
68+
# platform-aware download cache) can short-circuit the linting passes
69+
# once SHELLCHECK_BIN is populated.
70+
if [[ -n "${SHELLCHECK_INSTALL_ONLY}" ]]; then
71+
echo "SHELLCHECK_INSTALL_ONLY set, exiting after install. SHELLCHECK_BIN=${SHELLCHECK_BIN}"
72+
exit 0
73+
fi
74+
6675
function calculate_params_for_severity() {
6776
declare SEVERITY="${SEVERITY:-"critical"}"
6877

0 commit comments

Comments
 (0)