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

Run shellcheck on shell/install.sh and make it pass #6313

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Nov 26, 2024

This is a partial subset of #5778.
This PR is meant as a way to more easily kickstart the use of shellcheck to lint checkout shell scripts.

Details of reason behind the shell changes:

  • SC2006: $() vs backticks
  • SC2268: The x-prefix is actually unnecessary
  • POSIX shell doesn't support local
  • SC2145: $@ in strings
  • missing quotes
  • SC2162: read without -r will interpret backslashes
  • variables inside the format string for printf could contain % which could make the command fail

This PR also make sure the script keeps passing shellcheck by adding it to our CI.

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Nov 26, 2024
@ElectreAAS
Copy link
Collaborator

Nice to see this going forward!

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

On the content, lgtm! It's better to split on 2 commits: the first that updates shell/install.sh and the other that adds the CI check and confirms it passes.
Plus the PR title/comments should highlight the new shellcheck CI check.

.github/workflows/ci.ml Outdated Show resolved Hide resolved
.github/scripts/main/hygiene.sh Outdated Show resolved Hide resolved
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.

3 participants