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/broodminder-export — 2 issue(s) grouped as one workstream. Part of the org SonarCloud tuning initiative combsmith/.github#593.
Add an explicit return statement at the end of the function.
Affected files
scripts/cron_backfill.sh (2)
Approach
Small mixed leftover findings (incl. TODO-tag tracking S1135); apply each rule's suggested fix per its message, or resolve/ticket TODOs. Grouped to avoid single-finding issues.
Acceptance
All listed SonarCloud findings for this repo/workstream resolved to zero
No behavior change; existing tests/CI green
Fixes are real (no blanket NOSONAR unless a confirmed false positive, noted inline)
Resolve two SonarCloud shell findings in scripts/cron_backfill.sh with behavior-preserving fixes: use [[ ]] for the conditional test (S7688) and add an explicit return to the ts() function (S7682).
scripts/cron_backfill.sh line 25: add explicit return at end of ts() function (S7682)
Tests to Write
None — this is a behavior-preserving shell refactor with no observable behavior change (Phase 2 TDD exception). Verification is via shellcheck and the existing Python contract suite staying green.
scripts/cron_backfill.sh line 25: added explicit return to ts() function (S7682)
Test Results
Lint (bash .dev-lead/scripts/dev-lead-lint.sh):
[lint] shellcheck on 1 file(s)...
[lint] validating .github/CODEOWNERS...
OK: .github/CODEOWNERS
[lint] all checks passed
=== lint exit 0 ===
Tests (pytest):
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0
testpaths: tests
collected 15 items
...
SKIPPED [15] tests/test_contract.py: BROODMINDER_API_KEY not set; live contract tests skipped
============================= 15 skipped in 0.03s ==============================
=== pytest exit 0 ===
The 15 contract tests are live tests that skip without BROODMINDER_API_KEY — expected in CI without credentials. Suite exits 0.
Files Changed
scripts/cron_backfill.sh: two behavior-preserving SonarCloud fixes — [[ ]] conditional test (S7688) and explicit return in the ts() helper (S7682).
Notes
Behavior-preserving refactor, so the TDD phase was skipped per the documented exception (no observable behavior change). [[ is safe here because the shebang is #!/usr/bin/env bash; a bare return propagates date's exit status and ts() is only used in command substitution, so both changes are semantically identical to the originals. No NOSONAR suppressions used — both fixes are real. Both listed findings for this workstream are resolved.
Resolve the two SonarCloud findings in scripts/cron_backfill.sh — shelldre:S7688 (use [[ instead of [) and shelldre:S7682 (explicit return at end of function) — with no behavior change.
Implementation Checklist
scripts/cron_backfill.sh — S7688: ensure the -x "$PY" conditional test uses [[ … ]] (not [ … ])
scripts/cron_backfill.sh — S7682: ensure the ts() function ends with an explicit return
Confirm no other [ … ] single-bracket tests or return-less functions remain in the file
Tests to Write
N/A — behavior-preserving shell lint fixes with no observable behavioral change. Verified instead via shellcheck --severity=warning (repo CI level) and the repo lint script. (Phase 2 TDD exception per the dev-lead workflow.)
Test Command
bash .dev-lead/scripts/dev-lead-lint.sh (shellcheck warning-level on scripts/**/*.sh + agent-profile validation); plus python -m pytest -q for the repo compliance suite.
Note: On inspection the current tree already satisfies both findings ([[ on line 23, return in ts()), consistent with the "(×2)" duplicate designation. I will verify this holds, apply any gap, and report — without fabricating a no-op change.
Both SonarCloud findings for scripts/cron_backfill.sh are already resolved in the current tree, so no source change was required. I verified each finding against the file rather than fabricating a no-op diff (consistent with the issue's "(×2)" duplicate designation, where the sibling workstream already landed the fix).
Finding-by-finding
shelldre:S7688 (use [[ instead of [): the only conditional test in the file already uses [[ … ]]:
# scripts/cron_backfill.sh:23
[[ -x"$PY" ]] || PY="python3"# fall back to system python if no venv
A scan confirms there are no single-bracket [ … ] tests remaining in the file.
shelldre:S7682 (explicit return at end of function): the only function, ts(), already ends with an explicit return:
# scripts/cron_backfill.sh:25-28ts() {
date -u +%Y-%m-%dT%H:%M:%SZ
return
}
shellcheck (warning level, CI parity): clean. (One SC2129style note about grouping redirects is out of scope for this issue and not flagged by the repo lint.)
(The 15 skips are live BroodMinder API contract tests, skipped without a key — expected.)
Files Changed
None. Working tree matches HEAD; both findings were already satisfied.
Acceptance
All listed SonarCloud findings (S7688, S7682) for this workstream resolved to zero
No behavior change; existing tests/CI green
Fixes are real ([[ and explicit return present in source — no NOSONAR used)
Notes
Phase 2 (TDD) skipped per the documented behavior-preserving exception — these are shell lint conformance items with no observable behavior change and no shell test harness in the repo; verified via shellcheck + repo lint instead.
The out-of-scope SC2129 style note was intentionally left unchanged to avoid modifying beyond the issue's two findings.
Closing as resolved. The shelldre:S7688 and shelldre:S7682 findings in scripts/cron_backfill.sh were addressed in PR #37 (commit fb0fbd2), which updated conditional tests to [[ and added an explicit return in ts().
Activity
don-petry commentedon Jul 3, 2026
Dev-Lead Implementation Plan
Issue: #24 — SonarCloud: misc cleanup (mixed findings) (×2)
Scope
Resolve two SonarCloud shell findings in
scripts/cron_backfill.shwith behavior-preserving fixes: use[[ ]]for the conditional test (S7688) and add an explicitreturnto thets()function (S7682).Implementation Checklist
scripts/cron_backfill.shline 23:[ -x "$PY" ]→[[ -x "$PY" ]](S7688)scripts/cron_backfill.shline 25: add explicitreturnat end ofts()function (S7682)Tests to Write
shellcheckand the existing Python contract suite staying green.Test Command
pytest(existing suite) +bash .dev-lead/scripts/dev-lead-lint.sh(shellcheck)don-petry commentedon Jul 3, 2026
Dev-Lead: Implementation Complete
Plan Execution
scripts/cron_backfill.shline 23:[ -x "$PY" ]→[[ -x "$PY" ]](S7688)scripts/cron_backfill.shline 25: added explicitreturntots()function (S7682)Test Results
Lint (
bash .dev-lead/scripts/dev-lead-lint.sh):Tests (
pytest):The 15 contract tests are live tests that skip without
BROODMINDER_API_KEY— expected in CI without credentials. Suite exits 0.Files Changed
scripts/cron_backfill.sh: two behavior-preserving SonarCloud fixes —[[ ]]conditional test (S7688) and explicitreturnin thets()helper (S7682).Notes
Behavior-preserving refactor, so the TDD phase was skipped per the documented exception (no observable behavior change).
[[is safe here because the shebang is#!/usr/bin/env bash; a barereturnpropagatesdate's exit status andts()is only used in command substitution, so both changes are semantically identical to the originals. NoNOSONARsuppressions used — both fixes are real. Both listed findings for this workstream are resolved.don-petry commentedon Jul 15, 2026
Dev-Lead Implementation Plan
Issue: #24 — SonarCloud: misc cleanup (mixed findings) (×2)
Scope
Resolve the two SonarCloud findings in
scripts/cron_backfill.sh—shelldre:S7688(use[[instead of[) andshelldre:S7682(explicitreturnat end of function) — with no behavior change.Implementation Checklist
scripts/cron_backfill.sh— S7688: ensure the-x "$PY"conditional test uses[[ … ]](not[ … ])scripts/cron_backfill.sh— S7682: ensure thets()function ends with an explicitreturn[ … ]single-bracket tests or return-less functions remain in the fileTests to Write
shellcheck --severity=warning(repo CI level) and the repo lint script. (Phase 2 TDD exception per the dev-lead workflow.)Test Command
bash .dev-lead/scripts/dev-lead-lint.sh(shellcheck warning-level onscripts/**/*.sh+ agent-profile validation); pluspython -m pytest -qfor the repo compliance suite.don-petry commentedon Jul 15, 2026
Dev-Lead: Implementation Complete
Summary
Both SonarCloud findings for
scripts/cron_backfill.share already resolved in the current tree, so no source change was required. I verified each finding against the file rather than fabricating a no-op diff (consistent with the issue's "(×2)" duplicate designation, where the sibling workstream already landed the fix).Finding-by-finding
shelldre:S7688(use[[instead of[): the only conditional test in the file already uses[[ … ]]:[ … ]tests remaining in the file.shelldre:S7682(explicitreturnat end of function): the only function,ts(), already ends with an explicitreturn:Verification
bash .dev-lead/scripts/dev-lead-lint.sh): passed — shellcheck--severity=warningclean onscripts/cron_backfill.sh, CODEOWNERS valid.SC2129style note about grouping redirects is out of scope for this issue and not flagged by the repo lint.)python -m pytest -q):(The 15 skips are live BroodMinder API contract tests, skipped without a key — expected.)
Files Changed
HEAD; both findings were already satisfied.Acceptance
[[and explicitreturnpresent in source — noNOSONARused)Notes
SC2129style note was intentionally left unchanged to avoid modifying beyond the issue's two findings.don-petry commentedon Oct 12, 2026
Closing as resolved. The shelldre:S7688 and shelldre:S7682 findings in scripts/cron_backfill.sh were addressed in PR #37 (commit fb0fbd2), which updated conditional tests to [[ and added an explicit return in ts().