Skip to content

SonarCloud: shell script hygiene #378

Closed

Description

@don-petry

SonarCloud: shell script hygiene

1 open SonarCloud finding(s) in petry-projects/broodly, worst severity MAJOR. Generated by the org SonarCloud Audit.

View in SonarCloud →

Findings

Rule Count Representative message
shelldre:S7682 1 Add an explicit return statement at the end of the function.

Affected files

  • tests/scripts/apply-repo-settings.test.sh (1)

Priority

Labeled priority:major — mapped from this bucket's worst SonarCloud severity (MAJOR).

Acceptance

  • All findings in this workstream resolved to zero in SonarCloud
  • No behavior change; CI green
  • Real fixes (no blanket NOSONAR unless a confirmed false positive, noted inline)

Idempotent issue — updated automatically each audit run; auto-closed when the finding count reaches zero.

Activity

  1. don-petry commented on Jul 14, 2026

    @don-petry
    ContributorAuthor

    SonarCloud Audit (2026-07-14): still open — 1 finding(s), worst severity MAJOR.

  2. added
    dev-leadFor dev-lead agent pickup
    and removed
    dev-leadFor dev-lead agent pickup
    on Jul 14, 2026
  3. don-petry commented on Jul 14, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #378 — SonarCloud: shell script hygiene

    Scope

    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

  4. don-petry commented on Jul 14, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • 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.

  5. added a commit that references this issue on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickuppriority:majorSonarCloud MAJOR severitysonarcloud-auditSonarCloud audit finding (idempotent marker)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions