Add shellcheck and Makefile for shell script linting#132
Merged
Conversation
- Create .shellcheckrc with bash dialect and stricter checks - Add shellcheck step to CI lint job - Add Makefile with lint and lint-fix targets - Remove unused HOST_RID variable in test-all.sh (SC2034) - Update CLAUDE.md, CONTRIBUTING.md, and how-to-security.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds shellcheck static analysis to enforce shell script quality alongside existing shfmt formatting. Developers can now run make lint locally to check both formatting and shell best practices, while CI validates both automatically.
Changes:
- Added shellcheck integration to CI workflow and local development via Makefile
- Created
.shellcheckrcconfiguration with bash dialect and stricter optional checks - Consolidated duplicate arm64/aarch64 case branches and removed unused
HOST_RIDvariable in test script
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.shellcheckrc |
Configures shellcheck with bash dialect and enables stricter optional checks for better shell script quality |
.github/workflows/ci.yml |
Adds shellcheck step to CI lint job to catch shell script issues automatically |
Makefile |
Provides convenient targets for running linters locally (lint, lint-fix, individual linter commands) |
tests/deb/test-all.sh |
Removes unused HOST_RID variable and consolidates duplicate arm64/aarch64 case branches |
CLAUDE.md |
Updates documentation to reflect shellcheck integration and new Makefile targets |
CONTRIBUTING.md |
Adds instructions for running linters locally via make lint and make lint-fix |
docs/how-to/how-to-security.md |
Documents shellcheck integration and references .shellcheckrc configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Apply ${VAR} convention to all shell code in GitHub workflow run blocks
for consistency with shellcheck's require-variable-braces rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhance shell script quality enforcement by adding shellcheck static analysis to CI and providing a Makefile for convenient local linting. Developers can now run
make lintlocally to check formatting and shell best practices before pushing, while CI catches shellcheck warnings in addition to formatting issues.Related Issues
Fixes #131
Changes
.shellcheckrcwith bash dialect and stricter optional checks enabledlint,lint-fix, and individual linter targetsHOST_RIDvariable intest-all.shto fix SC2034