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 {
184 // and the search field's hit region at accessibility sizes is the 184 // and the search field's hit region at accessibility sizes is the
185 // system's own control. Reading `elementType` here is safe; reading 185 // system's own control. Reading `elementType` here is safe; reading
186 // `frame` is not (it kills element attribution for the whole audit). 186 // `frame` is not (it kills element attribution for the whole audit).
187 if let type = issue.element?.elementType, type == .searchField || type == .textField { 187 if let type = issue.element?.elementType,
188 if issue.auditType.contains(.textClipped) || issue.auditType.contains(.hitRegion) { 188 type == .searchField || type == .textField,
189 return "system field placeholder/hit region, length-independent" 189 issue.auditType.contains(.textClipped) || issue.auditType.contains(.hitRegion) {
190 } 190 return "system field placeholder/hit region, length-independent"
191 } 191 }
192 192
193 // Unattributed clipped-text/dynamic-type findings. Bisection showed the 193 // Unattributed clipped-text/dynamic-type findings. Bisection showed the
Scripts/audit-a11y.sh +6 −6
@@ -43,14 +43,14 @@ DEPLOYMENT_TARGET=$(
43 | awk -F' = ' '/ IPHONEOS_DEPLOYMENT_TARGET = /{print $2; exit}' 43 | awk -F' = ' '/ IPHONEOS_DEPLOYMENT_TARGET = /{print $2; exit}'
44) 44)
45 45
46if [ -z "${DEPLOYMENT_TARGET:-}" ]; then 46if [[ -z "${DEPLOYMENT_TARGET:-}" ]]; then
47 echo "error: could not read IPHONEOS_DEPLOYMENT_TARGET" >&2 47 echo "error: could not read IPHONEOS_DEPLOYMENT_TARGET" >&2
48 exit 1 48 exit 1
49fi 49fi
50 50
51DT_MAJOR="${DEPLOYMENT_TARGET%%.*}" 51DT_MAJOR="${DEPLOYMENT_TARGET%%.*}"
52DT_MINOR="${DEPLOYMENT_TARGET##*.}" 52DT_MINOR="${DEPLOYMENT_TARGET##*.}"
53[ "$DT_MINOR" = "$DEPLOYMENT_TARGET" ] && DT_MINOR=0 53[[ "$DT_MINOR" = "$DEPLOYMENT_TARGET" ]] && DT_MINOR=0
54FLOOR_RANK=$(( DT_MAJOR * 1000 + DT_MINOR )) 54FLOOR_RANK=$(( DT_MAJOR * 1000 + DT_MINOR ))
55 55
56echo " deployment target: $DEPLOYMENT_TARGET (rank $FLOOR_RANK)" 56echo " deployment target: $DEPLOYMENT_TARGET (rank $FLOOR_RANK)"
@@ -82,7 +82,7 @@ run_tier() {
82 local sim udid label 82 local sim udid label
83 83
84 sim=$(select_sim "$which") 84 sim=$(select_sim "$which")
85 if [ -z "$sim" ]; then 85 if [[ -z "$sim" ]]; then
86 echo "error: no iPhone simulator at or above iOS $DEPLOYMENT_TARGET installed" >&2 86 echo "error: no iPhone simulator at or above iOS $DEPLOYMENT_TARGET installed" >&2
87 echo "hint: install one with 'xcodebuild -downloadPlatform iOS'" >&2 87 echo "hint: install one with 'xcodebuild -downloadPlatform iOS'" >&2
88 return 1 88 return 1
@@ -94,7 +94,7 @@ run_tier() {
94 echo 94 echo
95 echo "==> $which: $label" 95 echo "==> $which: $label"
96 96
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
98 echo " NOTE: nearest installed runtime is a major version above the $DEPLOYMENT_TARGET" 98 echo " NOTE: nearest installed runtime is a major version above the $DEPLOYMENT_TARGET"
99 echo " deployment target, so this is not true floor coverage." 99 echo " deployment target, so this is not true floor coverage."
100 fi 100 fi
@@ -113,7 +113,7 @@ run_tier() {
113} 113}
114 114
115status=0 115status=0
116if [ "$TIER" = "both" ]; then 116if [[ "$TIER" = "both" ]]; then
117 run_tier floor || status=1 117 run_tier floor || status=1
118 run_tier current || status=1 118 run_tier current || status=1
119else 119else
@@ -121,7 +121,7 @@ else
121fi 121fi
122 122
123echo 123echo
124if [ "$status" -eq 0 ]; then 124if [[ "$status" -eq 0 ]]; then
125 echo "==> Done. Findings above are the burndown list for issue #21." 125 echo "==> Done. Findings above are the burndown list for issue #21."
126 echo " They are reported, not enforced — widen" 126 echo " They are reported, not enforced — widen"
127 echo " AccessibilityAuditHarness.enforcedAuditTypes as each phase lands." 127 echo " AccessibilityAuditHarness.enforcedAuditTypes as each phase lands."