From 22c0c0bd3592c6147b0475d0bb2e34d6d4c53196 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 22 Oct 2025 15:19:20 -0500 Subject: [PATCH] Refactored shellcheck workflow to be ci/lint.sh and lint.yml workflow Also added ci/ and packaging/ but allowed those to fail. Ticket: none Changelog: none --- .github/workflows/{shellcheck.yml => lint.yml} | 5 +---- ci/lint.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) rename .github/workflows/{shellcheck.yml => lint.yml} (55%) create mode 100755 ci/lint.sh diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/lint.yml similarity index 55% rename from .github/workflows/shellcheck.yml rename to .github/workflows/lint.yml index a7822ad34..76a5d9688 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,4 @@ jobs: run: sudo apt install shellcheck - name: Lint sources with shellcheck run: | - # Recursively find all shell scripts in the build-scripts directory with a shebang - grep -Erl '^(#!/(bin|usr/bin)/(env )?(sh|bash))' build-scripts/ | while read -r file; do - shellcheck --external-sources --source-path=build-scripts "$file" - done + ./ci/lint.sh diff --git a/ci/lint.sh b/ci/lint.sh new file mode 100755 index 000000000..cf3856bd8 --- /dev/null +++ b/ci/lint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +shellcheck_dirs() { + grep -Erl '^(#!/(bin|usr/bin)/(env )?(sh|bash))' "$1" | while read -r file; do + shellcheck --external-sources --source-path=build-scripts "$file" + done +} + +shellcheck_dirs build-scripts/ + +# some dirs are "dirty" aka need some work so don't fail on those yet +shellcheck_dirs ci/ packaging/ || true