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
Resolve SonarCloud finding shelldre:S7682 by adding an explicit return statement at the end of the assert_contains function in tests/scripts/apply-repo-settings.test.sh. Behavior-preserving — the function's return value is never checked at any call site.
Implementation Checklist
tests/scripts/apply-repo-settings.test.sh — add explicit return 0 at end of assert_contains()
Tests to Write
None — pure behavior-preserving shell hygiene fix (Phase 2 exception). Verification is via running the existing test script and shellcheck.
Test Command
bash tests/scripts/apply-repo-settings.test.sh and bash .dev-lead/scripts/dev-lead-lint.sh
Added explicit return 0 at the end of the assert_contains() function in tests/scripts/apply-repo-settings.test.sh
Test Results
=== TEST SCRIPT ===
ok - enforces secret_scanning
ok - enforces secret_scanning_push_protection
ok - enforces secret_scanning_ai_detection
ok - enforces secret_scanning_non_provider_patterns
ok - sets security_and_analysis status to enabled
ok - enforces vulnerability-alerts
ok - enforces automated-security-fixes
---
PASS — 7 assertion(s) passed
=== SHELLCHECK ===
shellcheck clean
=== dev-lead-lint.sh ===
[lint] shellcheck on 2 file(s)...
[lint] validating CODEOWNERS...
OK: CODEOWNERS
[lint] all checks passed
Files Changed
tests/scripts/apply-repo-settings.test.sh: added an explicit return 0 at the end of assert_contains() to satisfy shelldre:S7682 (functions must end with an explicit return statement).
Notes
Behavior-preserving change — the function's return value is never checked at any of its 4 call sites, and both existing branches already terminated with a command that returns 0, so the explicit return 0 does not alter any observable behavior. No new tests were added per the Phase 2 exception for behavior-preserving refactors; verification was done by running the existing test script (7/7 pass), shellcheck (clean), and the required dev-lead lint check (all checks passed). No blanket NOSONAR used.
Activity
don-petry commentedon Jul 14, 2026
SonarCloud Audit (2026-07-14): still open — 1 finding(s), worst severity
MAJOR.don-petry commentedon Jul 14, 2026
Dev-Lead Implementation Plan
Issue: #378 — SonarCloud: shell script hygiene
Scope
Resolve SonarCloud finding shelldre:S7682 by adding an explicit
returnstatement at the end of theassert_containsfunction intests/scripts/apply-repo-settings.test.sh. Behavior-preserving — the function's return value is never checked at any call site.Implementation Checklist
tests/scripts/apply-repo-settings.test.sh— add explicitreturn 0at end ofassert_contains()Tests to Write
Test Command
bash tests/scripts/apply-repo-settings.test.shandbash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jul 14, 2026
Dev-Lead: Implementation Complete
Plan Execution
return 0at the end of theassert_contains()function intests/scripts/apply-repo-settings.test.shTest Results
Files Changed
tests/scripts/apply-repo-settings.test.sh: added an explicitreturn 0at the end ofassert_contains()to satisfy shelldre:S7682 (functions must end with an explicit return statement).Notes
Behavior-preserving change — the function's return value is never checked at any of its 4 call sites, and both existing branches already terminated with a command that returns 0, so the explicit
return 0does not alter any observable behavior. No new tests were added per the Phase 2 exception for behavior-preserving refactors; verification was done by running the existing test script (7/7 pass), shellcheck (clean), and the required dev-lead lint check (all checks passed). No blanketNOSONARused.feat: implement issue #378 — SonarCloud: shell script hygiene (#393)