Repository navigation
Description
Lane: openreposhape-2 (openRepoShape-2)
What is wrong. SonarCloud's reliability and maintainability gates on
main (cd57c4b) carry fifteen findings against setup.sh, all in the
argument-scanning and self-bootstrap code added for #39/#50/#63:
shelldre:S7688("Use[[instead of[for conditional tests"), 7
occurrences — two tests on one line: line 88
([ -n "$toplevel" ],[ -f "$toplevel/scaffold-project.py" ]), then one
each at line 89 ([ -f "$toplevel/contracts/repository-naming.yaml" ]),
163 ([ "${#SHAPE_REF}" -gt 255 ]), 179
([ "$KEEP_SHAPE_CHECKOUT" -eq 1 ]), 193 ([ -n "$SHAPE_REF" ]) and 198
([ -n "$SHAPE_REF" ]).shelldre:S131("Add a default case (*) to handle unexpected values"),
8 occurrences, one percasethat has no*)arm: lines 51 (uname -s
dispatch for$MAC_TOOLS), 125 ($SHAPE_REPObad-value guard), 142, 143
and 144 (the three one-linecases scanning$@for--,
--shape-ref's value and--keep-shape-checkout), 166 ($SHAPE_REF
control-character guard), 169 ($SHAPE_REFcharset guard) and 192
($SHAPE_REPOscheme check that decides whether--depth 1is added).
These are the repository's only RELIABILITY findings; everything else on the
gate today is on other files. setup.sh's own shebang is #!/usr/bin/env bash, every entry point that runs it does so with bash explicitly
(bash -s -- in the one-liner, ["bash", str(SETUP), ...] in
tests/test_setup_sh.py, /bin/bash -n setup.sh in
.github/workflows/tests.yml), and the file already uses bash-only syntax
(arrays: CLONE_SHAPE_CMD=(git clone --quiet) / += / [@], and
BASH_SOURCE) — so [[ is available everywhere this script runs. The
"POSIX shell script" phrasing in tests/test_setup_sh.py and
tests/conftest.py is contrasting a Unix shell/shebang execution model
against Windows' CreateProcess (which cannot run a shebang at all), not
claiming /bin/sh(dash) compatibility — README.md's "What setup.sh does"
and the macOS CI step both say the constraint is bash 3.2 syntax, not POSIX
sh.
What would fix it. Convert each flagged [ … ] to [[ … ]] with
identical semantics (all seven are unary -n/-f/-eq/-gttests — no=/==/!=string comparison and no-a/-oin any of them, so nothing needs quoting-as-a-glob-pattern care or operator translation). For eachcaselacking), add ) ;;— every one of the eight is a guard or a scan where "no match" is the common, already-correct outcome (an unenumerateduname -s, an argument that is not the flag being scanned for, a $SHAPE_REPO/$SHAPE_REFvalue that is already well-formed) rather than a programming error, so a silent no-op with a short comment is the honest default, not adie`. No existing branch's behavior changes.
Activity
brettheap commentedon Sep 11, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-11T20:13Z) CLAIMED — session 3b1ab8cf, on Brett Heap's word 'go, fan out on all of it'. Branch fix/setup-sh-double-bracket-and-case-defaults, worktree ~/projects/openRepoShape--setup-sh-hygiene on Eagle, from origin/main cd57c4b. Scope: convert setup.sh's 7 S7688
[tests to[[and add*) ;;defaults to its 8 S131casestatements, semantics unchanged.brettheap commentedon Sep 11, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-11T20:24Z) PULL REQUEST OPEN: #117 (head 11e1e3f).
setup.sh: SonarCloud's [[ and case-default reliability findings, sema…
brettheap commentedon Sep 11, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-11T20:39:55Z) MERGED — #117 → 9923fea (squash), on Brett Heap's word 'go, fan out on all of it, hold the doctor refactor'. setup.sh: the seven SonarCloud S7688 '[' tests become '[[' (all unary -n/-f/-eq/-gt, quoting untouched; the file is bash-only by shebang, one-liner and CI, nothing claims sh) and the eight S131 bare case statements gain a '*) ;;' default with a one-line reason, no branch behaviour changed; only setup.sh touched; bash -n clean, shellcheck identical before/after, test_setup_sh.py 38 passed; Copilot 'Approval recommended' with 0 findings; suite 984 passed / 1 known machine-dependent flake / 1 skipped. Object complete.