Skip to content

GH-45050: [CI][Dev] Apply ShellCheck lint to c_glib/test/run-test.sh - #45052

Merged
kou merged 2 commits into
apache:mainfrom
tks1197:ci-shellcheck-c-glib-run-test
Dec 19, 2024
Merged

kou merged 2 commits into
apache:mainfrom
tks1197:ci-shellcheck-c-glib-run-test

Conversation

@tks1197

@tks1197 tks1197 commented Dec 17, 2024 •

Copy link
Copy Markdown
Contributor

Rationale for this change

❯ pre-commit run --show-diff-on-failure --color=always --all-files shellcheck
ShellCheck v0.10.0.......................................................Failed

- hook id: shellcheck
- exit code: 1

In c_glib/test/run-test.sh line 20:
test_dir="$(cd $(dirname $0); pwd)"
            ^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
               ^-----------^ SC2046 (warning): Quote this to prevent word splitting.
                         ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
test_dir="$(cd $(dirname "$0") || exit; pwd)"

In c_glib/test/run-test.sh line 50:
  MODULE_TYPELIB_DIR_VAR_NAME="$(echo ${module} | tr a-z- A-Z_)_TYPELIB_DIR"
                                      ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
  MODULE_TYPELIB_DIR_VAR_NAME="$(echo "${module}" | tr a-z- A-Z_)_TYPELIB_DIR"

In c_glib/test/run-test.sh line 77:
${DEBUGGER} "${DEBUGGER_ARGS[@]}" "${RUBY}" ${test_dir}/run-test.rb "$@"
                                            ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
${DEBUGGER} "${DEBUGGER_ARGS[@]}" "${RUBY}" "${test_dir}"/run-test.rb "$@"

For more information:
  <https://www.shellcheck.net/wiki/SC2046> -- Quote this to prevent word splitt...
  <https://www.shellcheck.net/wiki/SC2164> -- Use 'cd ... || exit' or 'cd ... |...
  <https://www.shellcheck.net/wiki/SC2086> -- Double quote to prevent globbing ...

What changes are included in this PR?

  • add missing double quotes(SC2046,SC2086)
  • Use cd ... || exit in case cd fails.(SC2164)

Are these changes tested?

yes

Are there any user-facing changes?

no

@tks1197
tks1197 requested review from kou and raulcd as code owners December 17, 2024 17:10
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #45050 has been automatically assigned in GitHub to PR creator.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #45050 has no components, please add labels for components.

Comment thread c_glib/test/run-test.sh Resolved
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 9e08c57.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 9 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants