You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
set -Eeuo pipefail Is Bash-Only, but the Shell Rules' Own Target Discovery Includes sh Shebangs #1182
Meanwhile the same rules define their own target set to include sh:
Neither is scoped to the *.sh glob alone: a tracked, extension-less script whose shebang names bash or sh joins the target list too.
And scripts/docker_lint.py's shellcheck and shfmt entries both set discover_shebang=True on that same shape, as does .github/workflows/validate-task.yml's target-building step.
So a repository carrying a #!/bin/sh script is inside the rule's declared scope and cannot satisfy the rule.
Why It Is Not Just Theoretical
CODESTYLE.md "Shell" scopes shell to "Bash, and only where a program cannot be Python", which reads as forbidding sh outright. If that is the intent, then the discovery shape is what is wrong, since it goes looking for sh scripts the fleet does not permit. If sh is permitted for the narrow bootstrap cases the same sentence describes, a script that must run before a toolchain exists, then the strict-mode line needs a POSIX form for them.
Either way one of the two is wrong today, and a carrier reading only the rule cannot tell which.
What Settling It Needs
A decision, which is why this is filed rather than patched:
sh is not permitted. Say so in the rule, and narrow the discovery in docker_lint.py and validate-task.yml to bash shebangs, so the tooling stops claiming targets the rules disown.
sh is permitted for bootstraps. Give it its own strict-mode line, set -eu being the portable subset, and say which shape takes which.
Option 2 looks likelier given the bootstrap carve-out already in the text, but the rule as written admits neither.
Provenance
CodeRabbit on #1179. Verified here against dash, scripts/docker_lint.py's discover_shebang entries, and .github/workflows/validate-task.yml's target discovery.
Answered by the maintainer on 2026-09-11: sh is not permitted. Say so in the shell rules, and narrow the target discovery in docker_lint.py and validate-task.yml to bash only, so the rule and the discovery agree. This is the opposite of the lean the issue recorded, so the sh-shebang half of discovery goes rather than gaining a portable strict-mode line. Removing the decision label, since the question is answered and the implementation remains.
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.
Activity
ptr727 commentedon Sep 11, 2026
Answered by the maintainer on 2026-09-11: sh is not permitted. Say so in the shell rules, and narrow the target discovery in
docker_lint.pyandvalidate-task.ymlto bash only, so the rule and the discovery agree. This is the opposite of the lean the issue recorded, so the sh-shebang half of discovery goes rather than gaining a portable strict-mode line. Removing thedecisionlabel, since the question is answered and the implementation remains.ptr727 commentedon Oct 23, 2026
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.