Skip to content

Commit e75ecda

Browse files
GH-46794: [CI][Dev] Fix shellcheck errors in the ci/scripts/csharp_test.sh (#46795)
### Rationale for this change This is the sub issue #44748. * SC2155: Declare and assign separately to avoid masking return values. * SC2086: Double quote to prevent globbing and word splitting. ``` shellcheck ci/scripts/csharp_test.sh In ci/scripts/csharp_test.sh line 33: export PYTHONNET_PYDLL=$(${PYTHON} -m find_libpython) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ci/scripts/csharp_test.sh line 35: pushd ${source_dir} ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "${source_dir}" For more information: https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ``` ### What changes are included in this PR? * Declare and assign a variable separately. * Quoting like `"${source_dir}"` ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #46794 Authored-by: Hiroyuki Sato <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 639201b commit e75ecda

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ repos:
307307
?^ci/scripts/cpp_test\.sh$|
308308
?^ci/scripts/csharp_build\.sh$|
309309
?^ci/scripts/csharp_pack\.sh$|
310+
?^ci/scripts/csharp_test\.sh$|
310311
?^ci/scripts/download_tz_database\.sh$|
311312
?^ci/scripts/install_azurite\.sh$|
312313
?^ci/scripts/install_ccache\.sh$|

ci/scripts/csharp_test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ if [ -z "${PYTHON}" ]; then
3030
fi
3131
fi
3232
${PYTHON} -m pip install pyarrow find-libpython
33-
export PYTHONNET_PYDLL=$(${PYTHON} -m find_libpython)
33+
PYTHONNET_PYDLL=$(${PYTHON} -m find_libpython)
34+
export PYTHONNET_PYDLL
3435

35-
pushd ${source_dir}
36+
pushd "${source_dir}"
3637
dotnet test
3738
popd

0 commit comments

Comments
 (0)