Commit 7001577e67

7001577e6798530c943ac4cf03258bc172927a67

parent: a7d154e1db

Unsigned

cmc <hello@cleberg.net> · 2026-07-25 03:58 UTC

chore: clear actionable SonarCloud smells (shell [[, merged if)

- Scripts/audit-a11y.sh: replace `[ ... ]` with `[[ ... ]]` in the seven
  shell conditionals SonarCloud flagged (shelldre:S7688). The script is bash
  (`#!/usr/bin/env bash`), so `[[` is safe and avoids word-splitting/globbing
  footguns. The jq `[ .devices | ... ]` filter is untouched — it is not a
  shell test.
- AccessibilityAuditHarness.swift: fold the nested `if` in the noise
  classifier into a single conditional (swift:S1066); behavior unchanged.

The remaining open SonarCloud issues (S1075 https literals, S115 external-JSON
CodingKeys, S107 parameter counts, S3087 callback nesting) are false positives
or intentional and are being resolved as Won't Fix / Safe in SonarCloud,
consistent with the v4.8.3 static-analysis policy in RELEASE_ROADMAP.md.

Layout: unified · split

DomainDigUITests/AccessibilityAuditHarness.swift +4 −4
@@ -184,10 +184,10 @@ enum AccessibilityAuditHarness {
184184 // and the search field's hit region at accessibility sizes is the
185185 // system's own control. Reading `elementType` here is safe; reading
186186 // `frame` is not (it kills element attribution for the whole audit).
187 if let type = issue.element?.elementType, type == .searchField || type == .textField {
188 if issue.auditType.contains(.textClipped) || issue.auditType.contains(.hitRegion) {
189 return "system field placeholder/hit region, length-independent"
190 }
187 if let type = issue.element?.elementType,
188 type == .searchField || type == .textField,
189 issue.auditType.contains(.textClipped) || issue.auditType.contains(.hitRegion) {
190 return "system field placeholder/hit region, length-independent"
191191 }
192192
193193 // Unattributed clipped-text/dynamic-type findings. Bisection showed the
Scripts/audit-a11y.sh +6 −6
@@ -43,14 +43,14 @@ DEPLOYMENT_TARGET=$(
4343 | awk -F' = ' '/ IPHONEOS_DEPLOYMENT_TARGET = /{print $2; exit}'
4444)
4545
46if [ -z "${DEPLOYMENT_TARGET:-}" ]; then
46if [[ -z "${DEPLOYMENT_TARGET:-}" ]]; then
4747 echo "error: could not read IPHONEOS_DEPLOYMENT_TARGET" >&2
4848 exit 1
4949fi
5050
5151DT_MAJOR="${DEPLOYMENT_TARGET%%.*}"
5252DT_MINOR="${DEPLOYMENT_TARGET##*.}"
53[ "$DT_MINOR" = "$DEPLOYMENT_TARGET" ] && DT_MINOR=0
53[[ "$DT_MINOR" = "$DEPLOYMENT_TARGET" ]] && DT_MINOR=0
5454FLOOR_RANK=$(( DT_MAJOR * 1000 + DT_MINOR ))
5555
5656echo " deployment target: $DEPLOYMENT_TARGET (rank $FLOOR_RANK)"
@@ -82,7 +82,7 @@ run_tier() {
8282 local sim udid label
8383
8484 sim=$(select_sim "$which")
85 if [ -z "$sim" ]; then
85 if [[ -z "$sim" ]]; then
8686 echo "error: no iPhone simulator at or above iOS $DEPLOYMENT_TARGET installed" >&2
8787 echo "hint: install one with 'xcodebuild -downloadPlatform iOS'" >&2
8888 return 1
@@ -94,7 +94,7 @@ run_tier() {
9494 echo
9595 echo "==> $which: $label"
9696
97 if [ "$which" = "floor" ] && [ "$(echo "$sim" | jq -r .rank)" -ge $(( (DT_MAJOR + 1) * 1000 )) ]; then
97 if [[ "$which" = "floor" ]] && [[ "$(echo "$sim" | jq -r .rank)" -ge $(( (DT_MAJOR + 1) * 1000 )) ]]; then
9898 echo " NOTE: nearest installed runtime is a major version above the $DEPLOYMENT_TARGET"
9999 echo " deployment target, so this is not true floor coverage."
100100 fi
@@ -113,7 +113,7 @@ run_tier() {
113113}
114114
115115status=0
116if [ "$TIER" = "both" ]; then
116if [[ "$TIER" = "both" ]]; then
117117 run_tier floor || status=1
118118 run_tier current || status=1
119119else
@@ -121,7 +121,7 @@ else
121121fi
122122
123123echo
124if [ "$status" -eq 0 ]; then
124if [[ "$status" -eq 0 ]]; then
125125 echo "==> Done. Findings above are the burndown list for issue #21."
126126 echo " They are reported, not enforced — widen"
127127 echo " AccessibilityAuditHarness.enforcedAuditTypes as each phase lands."