Skip to content

Add CI workflow to check for problems with shell scripts #11

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

Merged
merged 5 commits into from
Dec 19, 2022

Conversation

MatteoPologruto
Copy link
Contributor

On every push or pull request that modifies one of the shell scripts in the repository, and periodically, the workflow:

  • Runs ShellCheck to detect common problems.
  • Runs shfmt to check formatting.
  • Checks for forgotten executable script file permissions.

Scripts inside subdirectories of deps have been excluded from the checks. Most of the suggestions made by ShellCheck have been applied to build_libs.sh, except for this one, since it should not be an error:

In ./deps/build_libs.sh line 3:
export PREFIX=/opt/lib/${CROSS_COMPILE}
                       ^--------------^ SC2[15](https://github.com/MatteoPologruto/crossbuild/actions/runs/3639769002/jobs/6143576989#step:7:16)3 (info): Possible misspelling: CROSS_COMPILE may not be assigned. Did you mean CROSS_COMPILER?

For more information:
  https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: CROSS_COMPI...
task: Failed to run task "shell:check": exit status 1

@MatteoPologruto MatteoPologruto added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Dec 7, 2022
@MatteoPologruto MatteoPologruto self-assigned this Dec 7, 2022
On every push or pull request that modifies one of the shell scripts in the repository, and periodically, the workflow:

- Runs ShellCheck to detect common problems.
- Runs shfmt to check formatting.
- Checks for forgotten executable script file permissions.
Copy link

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Matteo!

@MatteoPologruto MatteoPologruto merged commit 609f7e9 into arduino:main Dec 19, 2022
@MatteoPologruto MatteoPologruto deleted the check-shell branch December 19, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants