Skip to content

Run shellcheck on shell/install.sh and make it pass, add a CI job to check next changes#6313

Merged
kit-ty-kate merged 2 commits intoocaml:masterfrom
kit-ty-kate:shell-check-install
Dec 2, 2024
Merged

Run shellcheck on shell/install.sh and make it pass, add a CI job to check next changes#6313
kit-ty-kate merged 2 commits intoocaml:masterfrom
kit-ty-kate:shell-check-install

Conversation

@kit-ty-kate
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Nice to see this going forward!

Copy link
Copy Markdown
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.

@kit-ty-kate kit-ty-kate force-pushed the shell-check-install branch 2 times, most recently from de764d4 to 1e2f399 Compare November 28, 2024 18:37
@kit-ty-kate kit-ty-kate requested a review from rjbou November 28, 2024 18:38
@rjbou rjbou force-pushed the shell-check-install branch from 1e2f399 to 1004840 Compare December 2, 2024 11:09
Copy link
Copy Markdown
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.

I've added an entry for the first commit in changelog. Otherwise, LGTM!!

@rjbou rjbou changed the title Run shellcheck on shell/install.sh and make it pass Run shellcheck on shell/install.sh and make it pass, add a CI job to check next changes Dec 2, 2024
@kit-ty-kate kit-ty-kate merged commit 432c00c into ocaml:master Dec 2, 2024
@kit-ty-kate kit-ty-kate deleted the shell-check-install branch December 2, 2024 12:08
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