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] fix some shellcheck errors in scripts #6504

Closed
Closed
Show file tree
Hide file tree
Changes from 3 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
34 changes: 17 additions & 17 deletions .ci/install-clang-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ add-apt-repository -y "deb-src http://apt.llvm.org/unstable/ llvm-toolchain-${CL
apt-get update -y

apt-get install -y --no-install-recommends \
clang-${CLANG_VERSION} \
clangd-${CLANG_VERSION} \
clang-format-${CLANG_VERSION} \
clang-tidy-${CLANG_VERSION} \
clang-tools-${CLANG_VERSION} \
lldb-${CLANG_VERSION} \
lld-${CLANG_VERSION} \
llvm-${CLANG_VERSION}-dev \
llvm-${CLANG_VERSION}-tools \
libomp-${CLANG_VERSION}-dev \
libc++-${CLANG_VERSION}-dev \
libc++abi-${CLANG_VERSION}-dev \
libclang-common-${CLANG_VERSION}-dev \
libclang-${CLANG_VERSION}-dev \
libclang-cpp${CLANG_VERSION}-dev \
libunwind-${CLANG_VERSION}-dev
clang-"${CLANG_VERSION}" \
shreyash2002 marked this conversation as resolved.
Show resolved Hide resolved
clangd-"${CLANG_VERSION}" \
clang-format-"${CLANG_VERSION}" \
clang-tidy-"${CLANG_VERSION}" \
clang-tools-"${CLANG_VERSION}" \
lldb-"${CLANG_VERSION}" \
lld-"${CLANG_VERSION}" \
llvm-"${CLANG_VERSION}"-dev \
llvm-"${CLANG_VERSION}"-tools \
libomp-"${CLANG_VERSION}"-dev \
libc++-"${CLANG_VERSION}"-dev \
libc++abi-"${CLANG_VERSION}"-dev \
libclang-common-"${CLANG_VERSION}"-dev \
libclang-"${CLANG_VERSION}"-dev \
libclang-cpp"${CLANG_VERSION}"-dev \
libunwind-"${CLANG_VERSION}"-dev

# overwriting the stuff in /usr/bin is simpler and more reliable than
# updating PATH, LD_LIBRARY_PATH, etc.
cp --remove-destination /usr/lib/llvm-${CLANG_VERSION}/bin/* /usr/bin/
cp --remove-destination /usr/lib/llvm-"${CLANG_VERSION}"/bin/* /usr/bin/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cp --remove-destination /usr/lib/llvm-"${CLANG_VERSION}"/bin/* /usr/bin/
cp --remove-destination "$(echo /usr/lib/llvm-${CLANG_VERSION}/bin/*)" /usr/bin/


# per https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang
#
Expand Down
2 changes: 1 addition & 1 deletion .ci/set_commit_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sha=$3

data=$(
jq -n \
--arg state $status \
--arg state "$status" \
--arg url "${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}" \
--arg name "$name" \
'{"state":$state,"target_url":$url,"context":$name}'
Expand Down
6 changes: 3 additions & 3 deletions .ci/trigger_dispatch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pr=$(
data=$(
jq -n \
--arg event_type "$dispatch_name" \
--arg pr_number "$(echo $pr | jq '.number')" \
--arg pr_sha "$(echo $pr | jq '.head.sha')" \
--arg pr_branch "$(echo $pr | jq '.head.ref')" \
--arg pr_number "$(echo "$pr" | jq '.number')" \
--arg pr_sha "$(echo "$pr" | jq '.head.sha')" \
--arg pr_branch "$(echo "$pr" | jq '.head.ref')" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Putting double quotes inside other double quotes like this requires escaping. To avoid that, please revert these changes and instead add the following comment on line 37 (directly above data=$():

# shellcheck disable=SC0286

--arg comment_number "$comment_id" \
'{"event_type":$event_type,"client_payload":{"pr_number":$pr_number,"pr_sha":$pr_sha,"pr_branch":$pr_branch,"comment_number":$comment_number}}'
)
Expand Down