Skip to content

GH-46662: [CI][Dev] Fix shellcheck SC2148 errors in ci/scripts directory - #46663

Merged
kou merged 3 commits into
apache:mainfrom
hiroyuki-sato:topic/shellcheck-sc2148
Jun 2, 2025
Merged

kou merged 3 commits into
apache:mainfrom
hiroyuki-sato:topic/shellcheck-sc2148

Conversation

@hiroyuki-sato

@hiroyuki-sato hiroyuki-sato commented Jun 2, 2025 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

We are trying to implement shellcheck on all sh files in #44748.

What changes are included in this PR?

  • SC2148: Add shellcheck shell=bash in util_* files
In ci/scripts/util_enable_core_dumps.sh line 1:
# Licensed to the Apache Software Foundation (ASF) under one
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions

github-actions Bot commented Jun 2, 2025

Copy link
Copy Markdown

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

Comment thread ci/scripts/util_enable_core_dumps.sh Outdated
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

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.

Suggested change
#!/usr/bin/env bash
#!/usr/bin/env bash
#

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.

No.

We should not add shebang to util_*.sh because we don't execute them directly. We use them as source XXX.sh.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. I added shellcheck disable=SC2148 instead of shebang.

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.

Can we use the following instead of disabling it?

https://www.shellcheck.net/wiki/SC2148

Use a shellcheck directive, adding # shellcheck shell=ksh before the first command in the file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. replace to shellcheck shell=bash.

@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 19aadb2.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 6 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants