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

Merged
merged 1 commit into from
May 22, 2025

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 

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

@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
@smuppand smuppand force-pushed the workflow branch 2 times, most recently from 18fc69e to b6e4127 Compare May 21, 2025 06:40
@smuppand smuppand force-pushed the workflow branch 2 times, most recently from 05aaf7c to aba7a6f Compare May 21, 2025 07:36
… on all shell scripts within the repository.

It helps enforce shell scripting best practices and maintain consistent code quality across test suites.

Key additions:
-  defines the CI job using latest stable ShellCheck.
- Targets  scripts recursively from the root.
- Fails the job if any warnings or errors are detected.

This integration ensures early feedback during pull requests and prevents merging poorly formatted or unsafe shell code.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@mwasilew mwasilew merged commit 29e0a9d into qualcomm-linux:main May 22, 2025
4 checks passed
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