fix(shell): declare the shell — shebang where executed, directive where sourced - #193
fix(shell): declare the shell — shebang where executed, directive where sourced#193hyperpolymath wants to merge 1 commit into
Conversation
…re sourced
shellcheck SC2148 ('target shell is unknown') on 12 files here.
Deliberately NOT a blanket shebang. The files split by how they are USED:
* 12 executed (have +x, never source'd) -> added '#!/usr/bin/env bash'
* 0 sourced (referenced by source/.) -> added '# shellcheck shell=bash'
A source'd file is never run as its own process, so a shebang there is
misleading — it claims an execution model the file does not have. The
shellcheck directive states the dialect without making that false claim.
Found by an estate-wide sweep of 5,111 tracked scripts across 375 repos: 85
files lack a shell declaration. 40 of those were left alone deliberately —
they are vendored duplicates (7 identical copies of one recoverer.sh) or a
nested kith/ tree, and 37 of the 40 are never invoked by name anywhere, so
editing them would be churn in vendored code.
Remaining SC2148 in this repo after the change: 22
|
Warning Review limit reachedNext included review available in 51 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
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 |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
This pull request successfully addresses ShellCheck SC2148 by adding #!/usr/bin/env bash shebangs to 12 test scripts across the rescript-ecosystem.
Codacy analysis indicates that the changes are up to standards with no new quality issues or complexity regressions introduced. There are no critical security flaws or logic bugs identified that would prevent merging.
Test suggestions
- Verify that all 12 modified scripts pass ShellCheck SC2148 validation
- Ensure scripts remain functional when invoked directly as bash scripts
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that all 12 modified scripts pass ShellCheck SC2148 validation
2. Ensure scripts remain functional when invoked directly as bash scripts
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
|
Closing: every one of the 12 files in this PR is vendored third-party code, not ours to patch. They are the ReScript compiler's own test fixtures, carried in two separate vendored copies:
Adding a shebang to upstream test fixtures creates permanent divergence from ReScript upstream and will conflict on every future vendor sync, for a lint warning that does not affect us. The estate-wide sweep that produced this classified them as EXECUTED because they carry The genuine first-party shebang fixes from the same sweep stand: ambientops#335, boj-server#319, coord-tui#49. |
shellcheck
SC2148(target shell is unknown) on 12 files here.Deliberately not a blanket shebang. The files split by how they are used:
+x, neversourced)#!/usr/bin/env bashsource/.)# shellcheck shell=bashA
sourced file is never run as its own process, so a shebang there is misleading — it claims an execution model the file does not have. The shellcheck directive states the dialect without making that false claim.Found by an estate-wide sweep of 5,111 tracked scripts across 375 repos: 85 files lack a shell declaration. 40 were left alone deliberately — vendored duplicates (7 identical copies of one
recoverer.sh) or a nestedkith/tree, and 37 of the 40 are never invoked by name anywhere, so editing them would be churn in vendored code.Remaining
SC2148in this repo after the change: 22