Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update shellcheck.sh to pass all args to shellcheck #2657

Merged
merged 1 commit into from
Jan 25, 2024
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
6 changes: 3 additions & 3 deletions scripts/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ SYSTEM_VERSION="$(get_version shellcheck)"
if [[ "${SYSTEM_VERSION}" == "${VERSION}" ]]; then
SHELLCHECK=shellcheck
else
SHELLCHECK="${REPO_ROOT}/build/shellcheck"
# Try to install a local version
SHELLCHECK="${REPO_ROOT}/bin/shellcheck"
Copy link
Contributor Author

@marun marun Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably preferable to ./build to differentiate artifacts we create vs 3rd party. ./bin is also ignored.

LOCAL_VERSION="$(get_version "${SHELLCHECK}")"
if [[ -z "${LOCAL_VERSION}" || "${LOCAL_VERSION}" != "${VERSION}" ]]; then
if which sw_vers &> /dev/null; then
Expand All @@ -31,9 +31,9 @@ else
DIST="linux.${arch}"
fi
curl -s -L "https://github.com/koalaman/shellcheck/releases/download/${VERSION}/shellcheck-${VERSION}.${DIST}.tar.xz" | tar Jxv -C /tmp > /dev/null
mkdir -p "${REPO_ROOT}"/build
mkdir -p "$(dirname "${SHELLCHECK}")"
cp /tmp/shellcheck-"${VERSION}"/shellcheck "${SHELLCHECK}"
fi
fi

find "${REPO_ROOT}" -name "*.sh" -type f -print0 | xargs -0 "${SHELLCHECK}"
find "${REPO_ROOT}" -name "*.sh" -type f -print0 | xargs -0 "${SHELLCHECK}" "${@}"
Loading