Skip to content

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

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#319
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: a02254b9-e8a9-4221-b489-5f965654e8b9

📥 Commits

Reviewing files that changed from the base of the PR and between b327988 and c985bc2.

📒 Files selected for processing (1)
  • coord-tui/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. (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
coord-tui/shell/coord-hooks.sh (1)

1-1: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added shell script linting guidance to improve code quality checks.
    • No user-facing behaviour or command functionality has changed.

Walkthrough

The change adds a Bash ShellCheck directive to coord-tui/shell/coord-hooks.sh. It does not change runtime logic or command behaviour.

Changes

ShellCheck declaration

Layer / File(s) Summary
Add Bash dialect directive
coord-tui/shell/coord-hooks.sh
The script declares Bash as its shell dialect for ShellCheck. Runtime logic remains unchanged.

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

Merge Risk: ⚪ Minimal · up to c985b

This localized change declares the Bash dialect for a sourced script and introduces no actionable merge-blocking risk; it is merge-ready after normal checks and review.

Poem

A rabbit checks the shell at dawn
Bash is named, and warnings yawn
No commands change their pace
The script keeps its place
One neat line makes checks move on

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, its rationale, scope, and the resulting SC2148 status. However, it does not follow the repository template and omits the required checklist, explicit Changes secti… Update the description to use the repository template. Add the Summary, Changes, RSR Quality Checklist, and Testing sections. Mark applicable checklist items and state the exact validation commands or results. Include Screenshots only if ap…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the shell declaration change and distinguishes shebangs from ShellCheck directives. It is concise and directly related to the main change.
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 explains the change, its rationale, scope, and the resulting SC2148 status. However, it does not follow the repository template and omits the required checklist, explicit Changes section, Testing section, and Screenshots section.

Resolution

Update the description to use the repository template. Add the Summary, Changes, RSR Quality Checklist, and Testing sections. Mark applicable checklist items and state the exact validation commands or results. Include Screenshots only if applicable.

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
📝 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
Contributor

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
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR resolves the ShellCheck SC2148 warning ('No shebang found') by introducing the '# shellcheck shell=bash' directive to 'coord-tui/shell/coord-hooks.sh'. This approach correctly identifies the shell dialect for sourced files without incorrectly implying they are standalone executables.

The change aligns with shell scripting best practices and addresses the linting gaps identified in the acceptance criteria. No blockers or regressions were detected.

Test suggestions

  • Verify that ShellCheck successfully identifies the dialect as Bash for coord-hooks.sh and no longer reports SC2148.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that ShellCheck successfully identifies the dialect as Bash for coord-hooks.sh and no longer reports SC2148.

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

@hyperpolymath
hyperpolymath merged commit b299cb6 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