Skip to content

fix(shell): declare the shell — shebang where executed, directive where sourced - #49

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/shellcheck-shebang-and-shell-directive
Aug 27, 2026
Merged

fix(shell): declare the shell — shebang where executed, directive where sourced#49
hyperpolymath merged 1 commit into
mainfrom
fix/shellcheck-shebang-and-shell-directive

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

shellcheck SC2148 (target shell is unknown) on 1 files here.

Deliberately not a blanket shebang. The files split by how they are used:

class count fix
executed (has +x, never sourced) 0 #!/usr/bin/env bash
sourced (referenced by source/.) 1 # shellcheck shell=bash

A 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 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: 0

…re sourced

shellcheck SC2148 ('target shell is unknown') on 1 files here.

Deliberately NOT a blanket shebang. The files split by how they are USED:

  * 0 executed (have +x, never source'd)  -> added '#!/usr/bin/env bash'
  * 1 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: 0
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3d22fe22-428b-42d4-9819-9f6ce5527c2c

📥 Commits

Reviewing files that changed from the base of the PR and between 854591f and bba358d.

📒 Files selected for processing (1)
  • shell/coord-hooks.sh

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. (2)
  • GitHub Check: Gitar
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
shell/coord-hooks.sh (1)

1-1: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added shell dialect metadata to improve static analysis and code quality.
    • No user-visible behaviour has changed.

Walkthrough

The shell hook now declares its Bash dialect for ShellCheck. No runtime behaviour or exported entities changed.

Changes

ShellCheck directive

Layer / File(s) Summary
Declare Bash dialect
shell/coord-hooks.sh
Adds a ShellCheck directive that identifies the file as Bash.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to bba35

The PR adds a shell declaration to one sourced script without changing its execution behavior. No actionable merge-blocking risk remains, so it is merge-ready after normal checks and review.

Poem

A rabbit checked the shell today
Bash syntax now guides the way
No runtime paths were changed
Only ShellCheck’s view was arranged
Clean hops through the script ensue

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the change: it declares the shell dialect correctly for sourced files and avoids a misleading shebang.
Description check ✅ Passed The description directly explains the ShellCheck SC2148 fix, the sourced-file rationale, and the resulting repository status.
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: 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.

✨ Finishing Touches
📝 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The PR resolves the SC2148 ShellCheck warning in shell/coord-hooks.sh by applying a shell directive. This ensures correct dialect recognition for sourced files in accordance with the project's execution model policy. All automated quality and logic checks passed without any identified issues or risks.

Test suggestions

  • Run shellcheck on shell/coord-hooks.sh to ensure SC2148 is resolved and the dialect is correctly recognized.
  • Verify the script remains compatible when sourced in a Bash environment.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Run shellcheck on `shell/coord-hooks.sh` to ensure SC2148 is resolved and the dialect is correctly recognized.
2. Verify the script remains compatible when sourced in a Bash environment.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@hyperpolymath
hyperpolymath merged commit 64f3841 into main Aug 27, 2026
3 checks passed
@hyperpolymath
hyperpolymath deleted the fix/shellcheck-shebang-and-shell-directive branch August 27, 2026 03:26
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.

1 participant