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
SonarCloud open findings in petry-projects/google-app-scripts — 24 issue(s) grouped as one workstream. Part of the org SonarCloud tuning initiative combsmith/.github#593.
Mechanically resolve 24 SonarCloud shell findings across 4 scripts: convert 17 [ ... ] POSIX tests to [[ ... ]] (S7688) and redirect 7 Error: messages (plus their same-block usage/continuation lines) to stderr with >&2 (S7677). Behavior preserved.
Implementation Checklist
scripts/setup-dependabot-app.sh — 9× [→[[; stderr on Error: $cmd, Error: gh not authenticated, Error: Private key… (+ its continuation + Usage)
scripts/setup-pr-quality-ruleset.sh — 3× [→[[; stderr on Error: gh CLI…, Error: gh not authenticated (+ Usage)
scripts/setup-code-quality-ruleset.sh — 3× [→[[; stderr on Error: gh not authenticated (+ Usage)
scripts/apply-repo-settings.sh — 2× [→[[; stderr on Error: gh not authenticated (+ Usage)
Tests to Write
None. No shell-script test suite exists in this repo; this is a behavior-preserving refactor (Phase 2 TDD exception). Verification is via shellcheck + existing Jest suite (unaffected).
Test Command
npm test (Jest, unaffected) and bash .dev-lead/scripts/dev-lead-lint.sh (shellcheck)
> jest --runInBand
Test Suites: 12 passed, 12 total
Tests: 301 passed, 301 total
Snapshots: 0 total
Time: 4.811 s
Ran all test suites.
# shellcheck (dev-lead-lint.sh): 4 file(s), all checks passed
# npm run check (prettier --check + eslint): 0 errors (22 pre-existing warnings in unrelated Jest test files)
Files Changed
scripts/setup-dependabot-app.sh: 9 conditional tests [→[[; redirected Error: (×3) + its continuation + Usage: to stderr
No shell-script test suite exists in this repo, so Phase 2 (TDD) was skipped per the behavior-preserving-refactor exception. Verification was done via shellcheck --severity=warning and the existing Jest suite (301 tests, unaffected).
Beyond the 7 SonarCloud-flagged Error: lines, I also redirected the same-block Usage:-before-exit 1 messages and the multi-line "Private key not found" continuation to stderr, so each error-exit path is fully on stderr rather than split across stdout/stderr. This is consistent, standard-Unix hygiene and introduces no new findings.
Behavior otherwise unchanged: [[ ... ]] preserves the original quoted-string/file-test semantics; = comparison stays a literal string match (RHS quoted).
Activity
don-petry commentedon Jul 3, 2026
Dev-Lead Implementation Plan
Issue: #420 — SonarCloud: shell script hygiene cleanup (×24)
Scope
Mechanically resolve 24 SonarCloud shell findings across 4 scripts: convert 17
[ ... ]POSIX tests to[[ ... ]](S7688) and redirect 7Error:messages (plus their same-block usage/continuation lines) to stderr with>&2(S7677). Behavior preserved.Implementation Checklist
scripts/setup-dependabot-app.sh— 9×[→[[; stderr onError: $cmd,Error: gh not authenticated,Error: Private key…(+ its continuation + Usage)scripts/setup-pr-quality-ruleset.sh— 3×[→[[; stderr onError: gh CLI…,Error: gh not authenticated(+ Usage)scripts/setup-code-quality-ruleset.sh— 3×[→[[; stderr onError: gh not authenticated(+ Usage)scripts/apply-repo-settings.sh— 2×[→[[; stderr onError: gh not authenticated(+ Usage)Tests to Write
shellcheck+ existing Jest suite (unaffected).Test Command
npm test(Jest, unaffected) andbash .dev-lead/scripts/dev-lead-lint.sh(shellcheck)don-petry commentedon Jul 3, 2026
Dev-Lead: Implementation Complete
Plan Execution
scripts/setup-dependabot-app.sh— 9×[→[[,Error:/usage-exit paths →>&2scripts/setup-pr-quality-ruleset.sh— 3×[→[[, 2×Error:+ usage →>&2scripts/setup-code-quality-ruleset.sh— 3×[→[[,Error:+ usage →>&2scripts/apply-repo-settings.sh— 2×[→[[,Error:+ usage →>&2Resolves all 24 findings: 17× S7688 (
[→[[) + 7× S7677 (Error:messages → stderr).Test Results
Files Changed
scripts/setup-dependabot-app.sh: 9 conditional tests[→[[; redirectedError:(×3) + its continuation +Usage:to stderrscripts/setup-pr-quality-ruleset.sh: 3 conditional tests[→[[; redirectedError:(×2) +Usage:to stderrscripts/setup-code-quality-ruleset.sh: 3 conditional tests[→[[; redirectedError:+Usage:to stderrscripts/apply-repo-settings.sh: 2 conditional tests[→[[; redirectedError:+Usage:to stderrNotes
shellcheck --severity=warningand the existing Jest suite (301 tests, unaffected).Error:lines, I also redirected the same-blockUsage:-before-exit 1messages and the multi-line "Private key not found" continuation to stderr, so each error-exit path is fully on stderr rather than split across stdout/stderr. This is consistent, standard-Unix hygiene and introduces no new findings.[[ ... ]]preserves the original quoted-string/file-test semantics;=comparison stays a literal string match (RHS quoted).feat: implement issue #420 — SonarCloud: shell script hygiene cleanup…
feat: implement issue #420 — SonarCloud: shell script hygiene cleanup…