Skip to content

[WIP] ci: add ShellCheck workflow for shell script linting #32

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smuppand
Copy link
Contributor

  • Introduced a GitHub Actions workflow to run ShellCheck on all .sh files
  • Ensures shell scripts follow best practices and common standards
  • Helps catch syntax errors, quoting issues, and style problems early

This improves code quality and enforces consistency in shell script contributions.

@mwasilew @craigez @vnarapar 

- Introduced a GitHub Actions workflow to run ShellCheck on all .sh files
- Ensures shell scripts follow best practices and common standards
- Helps catch syntax errors, quoting issues, and style problems early

This improves code quality and enforces consistency in shell script contributions.

Signed-off-by: Srikanth Muppandam <[email protected]>
run: sudo apt-get install -y shellcheck
- name: Run ShellCheck
run: |
find . -name '*.sh' -exec shellcheck {} +
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably exclude some codes. In test definitions the following codes are excluded: SC1091 SC2230 SC3043

steps:
- uses: actions/checkout@v3
- name: Install ShellCheck
run: sudo apt-get install -y shellcheck
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe pin a version? Shellcheck behaviour changes in unpredicted way after upgrade. I'm currently using 0.9.0-1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apt-get may not retrieve this version. Do you recommend downloading version 0.9.0-1 and installing it manually to ensure it is available for use.?

@mwasilew
Copy link
Contributor

I think all checks should be green. If you want to introduce shellcheck you need to either fix all warnings beforehand or in the same PR.

@smuppand smuppand self-assigned this May 15, 2025
@smuppand smuppand changed the title ci: add ShellCheck workflow for shell script linting [WIP] ci: add ShellCheck workflow for shell script linting May 15, 2025
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