fix(shell): declare the dialect for the sourced contract.config.sh - #240
fix(shell): declare the dialect for the sourced contract.config.sh#240hyperpolymath wants to merge 1 commit into
Conversation
shellcheck SC2148 ('target shell is unknown') on contract.config.sh.
Deliberately a directive, not a shebang. The file is SOURCED by
tools/check-contract.sh and never executed as its own process, so a shebang
would claim an execution model it does not have. '# shellcheck shell=bash'
states the dialect without making that false claim.
Placed on line 2, immediately after the SPDX header, so the estate rule that
SPDX must be line 1 still holds — shellcheck directives are honoured anywhere
before the first command.
Found by an estate-wide sweep of 5,111 scripts across 375 repos: 85 files lack
a shell declaration. Only first-party files were changed; HOL's ATP scripts and
the ReScript compiler's own test fixtures were excluded as vendored upstream
code, where a shebang would create permanent divergence for a lint warning.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
|
| Layer / File(s) | Summary |
|---|---|
Declare Bash dialect contract.config.sh |
Adds a ShellCheck directive that identifies the script as Bash. |
Estimated code review effort: 1 (Trivial) | ~2 minutes
Merge Risk: ⚪ Minimal · up to e76b4
This localized change only declares the shell dialect for linting and does not alter runtime behavior; no actionable merge-blocking risk remains beyond normal checks and review.
Poem
A rabbit checks the Bash-bound line
ShellCheck reads the dialect sign
One small directive joins the code
The script now bears its proper mode
Carrots compile in neat array
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The description clearly explains the change, its rationale, placement, and scope. It does not provide the required RSR checklist status or a Testing section, so the template requirements are incomplet… | Add the required template sections. Mark each applicable RSR Quality Checklist item, and document the commands or checks used to test the change. Add Screenshots or terminal output if applicable. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and concisely identifies the Bash dialect declaration added to the sourced contract.config.sh file. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1… |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
Full details: Description check
Explanation
The description clearly explains the change, its rationale, placement, and scope. It does not provide the required RSR checklist status or a Testing section, so the template requirements are incomplete.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
- Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
This PR addresses the ShellCheck warning SC2148 in contract.config.sh by adding a shell directive. By using # shellcheck shell=bash instead of a shebang, the script is correctly identified as a sourced file rather than an executable. The directive is placed appropriately after the SPDX license header to comply with project standards. Codacy analysis confirms the PR is up to standards with no new quality or complexity issues.
Test suggestions
- Verify that ShellCheck no longer reports SC2148 for contract.config.sh.
- Ensure the script remains valid for sourcing by tools/check-contract.sh.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that ShellCheck no longer reports SC2148 for contract.config.sh.
2. Ensure the script remains valid for sourcing by tools/check-contract.sh.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback



shellcheck
SC2148(target shell is unknown) oncontract.config.sh.Deliberately a directive, not a shebang. The file is
sourced bytools/check-contract.shand never executed as its own process, so a shebang would claim an execution model it does not have.# shellcheck shell=bashstates the dialect without making that false claim.Placed on line 2, immediately after the SPDX header, so the estate rule that SPDX must be line 1 still holds — shellcheck directives are honoured anywhere before the first command.
Found by an estate-wide sweep of 5,111 scripts across 375 repos: 85 files lack a shell declaration. Only first-party files were changed — HOL's ATP scripts and the ReScript compiler's own test fixtures were excluded as vendored upstream code, where a shebang would create permanent divergence for a lint warning.