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

GH Actions: add shellcheck job + allow scripts to pass the new check #924

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 22, 2025

Detailed Description

GH Actions: add shellcheck job

Shellcheck is a static analysis tool for shell scripts, which can help find common mistakes, simplifications and point out best practices.

This commit adds a new GH Actions job to run shellcheck on all shell scripts in this repo.
At this moment, that means it will run over the tests/utils/proxy start/stop scripts, but more scripts are expected to be added in the near future.

I've researched the available action runners and found the ludeeus/action-shellcheck one to be the most popular as well as suitable for our needs.
Additionally, the lumaxis/shellcheck-problem-matchers will allow for showing any issues found inline in the GH code view via annotations.

Refs:

[INCOMPLETE] Shell scripts: various tweaks

Various tweaks to allow the scripts to pass the shellcheck checks.

⚠️ At this time, the scripts do NOT (yet) pass shellcheck - this is mostly due to quoting $ARGS in the start-stop-daemon command breaking the test runs. For that reason, this PR is being opened as draft.

jrfnl added 2 commits January 22, 2025 10:43
Shellcheck is a static analysis tool for shell scripts, which can help find common mistakes, simplifications and point out best practices.

This commit adds a new GH Actions job to run shellcheck on all shell scripts in this repo.
At this moment, that means it will run over the `tests/utils/proxy` start/stop scripts, but more scripts are expected to be added in the near future.

I've researched the available action runners and found the `ludeeus/action-shellcheck` one to be the most popular as well as suitable for our needs.
Additionally, the `lumaxis/shellcheck-problem-matchers` will allow for showing any issues found inline in the GH code view via annotations.

Refs:
* https://www.shellcheck.net/
* https://github.com/koalaman/shellcheck/wiki/Integration
* https://github.com/ludeeus/action-shellcheck
* https://github.com/lumaxis/shellcheck-problem-matchers
Various tweaks to allow the scripts to pass the shellcheck checks.
@jrfnl jrfnl added this to the 2.0.x Next milestone Jan 22, 2025
@jrfnl jrfnl requested a review from schlessera January 22, 2025 09:51
@jrfnl jrfnl mentioned this pull request Jan 22, 2025
2 tasks
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.

1 participant