Skip to content

fix: restore Apple builds under SwiftFormat 0.62.1#103098

Merged
steipete merged 1 commit into
mainfrom
codex/fix-swiftformat-062-lint-drift
Jul 9, 2026
Merged

fix: restore Apple builds under SwiftFormat 0.62.1#103098
steipete merged 1 commit into
mainfrom
codex/fix-swiftformat-062-lint-drift

Conversation

@steipete

@steipete steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where developers running Apple builds with SwiftFormat 0.62.1 would hit hundreds of pre-existing lint failures and pnpm ios:build would abort. SwiftFormat 0.62 newly enabled rules that conflict with the repository's established compact conditional and SwiftUI Group style.

Why This Change Was Made

The shared config now requires SwiftFormat 0.62.1 and explicitly disables wrapIfStatementBodies, wrapIfExpressionBodies, and redundantSwiftUIGroup. All three Apple CI consumers refresh and upgrade SwiftFormat before using that config, and shared Swift lint config changes now route through both macOS and iOS CI. This avoids a 172-file, 3,588-line formatting pass that would also make structural SwiftUI rewrites.

User Impact

Apple contributors can run the repository's iOS build and macOS Swift lint with Homebrew SwiftFormat 0.62.1 without unrelated formatter drift. There is no runtime behavior change.

Evidence

  • Before: the exact macOS CI lint command reported 1,026 diagnostics across 113/264 files; the iOS build-phase list reported 954 diagnostics across 59/180 files.
  • After: SwiftFormat 0.62.1 exact macOS CI lint command passes with 0/264 files require formatting, 2 files skipped.
  • pnpm ios:build — passed locally, including the always-run SwiftFormat phase; Xcode build succeeded in 226.984 seconds.
  • pnpm test src/scripts/ci-changed-scope.test.ts — 30/30 passed on Blacksmith Testbox lease tbx_01kx46qbdxwxt2x7zqy5ee8acv.
  • SwiftFormat 0.61.1 now exits early with the explicit --min-version 0.62.1 requirement instead of failing on unknown rule names.
  • Fresh autoreview: no accepted or actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Jul 9, 2026
@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 4:41 PM ET / 20:41 UTC.

Summary
The branch updates the shared SwiftFormat config for 0.62.1, refreshes SwiftFormat in Apple CI install steps, and routes shared Swift lint config changes through both macOS Swift and iOS build CI with regression coverage.

PR surface: Tests +15, Config +12, Other +7. Total +34 across 5 files.

Reproducibility: yes. A macOS environment using SwiftFormat 0.62.1 can reproduce this by running the shared SwiftFormat lint path or pnpm ios:build on current main; source shows both Apple lanes consume config/swiftformat, and the PR body provides before-fix diagnostics.

Review metrics: 2 noteworthy metrics.

  • SwiftFormat config contract: 1 minimum version added, 3 rules disabled. This is the formatter behavior contract that prevents SwiftFormat 0.62.1 from rewriting established Apple source style.
  • Apple CI formatter installs: 3 install steps changed. All macOS/iOS CI consumers that rely on the shared config now refresh and print the SwiftFormat version before using it.

Stored data model
Persistent data-model change detected: migration/backfill/repair: .github/workflows/ci.yml, migration/backfill/repair: .github/workflows/ios-periphery.yml. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Wait for macos-swift and Scan iOS dead code to finish on head 7d1da41.

Risk before merge

  • [P1] The exact-head macos-swift and Scan iOS dead code jobs were still pending when reviewed, so the changed Apple formatter automation should not merge before those lanes finish successfully.
  • [P1] The workflow intentionally upgrades to the current Homebrew SwiftFormat formula rather than pinning exactly 0.62.1, so maintainers need to accept that future formatter releases can again affect CI.

Maintainer options:

  1. Wait for exact-head Apple CI, then merge (recommended)
    Accept the Homebrew-latest formatter policy only after macos-swift, ios-build, and Scan iOS dead code pass on this head.
  2. Pin SwiftFormat before merge
    Change the workflow/tooling path to install an exact SwiftFormat 0.62.1 version if deterministic CI is more important than tracking Homebrew latest.
  3. Pause for CI policy ownership
    Keep this PR open if maintainers want an Apple CI owner to decide the formatter update policy before landing.

Next step before merge

  • [P2] Protected maintainer-labeled Apple CI/tooling PR should remain open for maintainer handling after exact-head Apple CI completes; there is no narrow automated repair to queue.

Maintainer decision needed

  • Question: Should maintainers merge this Apple tooling fix after exact-head Apple CI completes, or require an exact SwiftFormat pin before merge?
  • Rationale: The PR has the protected maintainer label and changes GitHub Actions Homebrew setup, so automation should not make the final CI package-policy choice.
  • Likely owner: steipete — He authored this PR and has the clearest recent history on the Swift config and Apple build surfaces involved.
  • Options:
    • Merge after Apple CI passes (recommended): Proceed with the focused Homebrew-latest mitigation once macos-swift, ios-build, and iOS Periphery pass on the exact head.
    • Pin SwiftFormat exactly: Hold the PR and require a deterministic SwiftFormat 0.62.1 installation path if maintainers do not want Apple CI tracking the Homebrew formula.
    • Pause for Apple CI owner: Leave the PR open for an Apple CI owner to choose a different formatter policy or validation bar.

Security
Cleared: The diff changes existing Homebrew tool installation commands and CI routing but adds no new permissions, secrets, action refs, lockfiles, package scripts, or downloaded executable source outside the existing Homebrew boundary.

Review details

Best possible solution:

Keep the narrow shared SwiftFormat config and CI-routing fix, then merge after exact-head Apple CI proves the Homebrew-upgraded formatter path or switch to an exact SwiftFormat pin if maintainers want deterministic installs.

Do we have a high-confidence way to reproduce the issue?

Yes. A macOS environment using SwiftFormat 0.62.1 can reproduce this by running the shared SwiftFormat lint path or pnpm ios:build on current main; source shows both Apple lanes consume config/swiftformat, and the PR body provides before-fix diagnostics.

Is this the best way to solve the issue?

Yes. Disabling the three new formatter rules in the shared config and routing shared Swift lint config changes through both Apple lanes is narrower than a 172-file source reformat; the remaining choice is whether Homebrew latest is acceptable or should be replaced by an exact pin.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bb16ca50d622.

Label changes

Label justifications:

  • P2: The PR fixes a normal-priority Apple developer and CI build failure with limited runtime blast radius.
  • merge-risk: 🚨 automation: The diff changes GitHub Actions Homebrew setup for Apple CI, so merge should wait for exact-head Apple automation proof.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes before/after SwiftFormat diagnostics plus copied pnpm ios:build and focused test output; terminal/live-output proof is sufficient for this non-visual tooling change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after SwiftFormat diagnostics plus copied pnpm ios:build and focused test output; terminal/live-output proof is sufficient for this non-visual tooling change.
Evidence reviewed

PR surface:

Tests +15, Config +12, Other +7. Total +34 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 0 +15
Docs 0 0 0 0
Config 2 15 3 +12
Generated 0 0 0 0
Other 2 10 3 +7
Total 5 40 6 +34

What I checked:

  • Repository policy read: Root AGENTS.md and scripts/AGENTS.md were read fully; the scripts guide says changed-file verification should stay centralized in scripts/ci-changed-scope.mjs, which is the path this PR edits. (scripts/AGENTS.md:5, bb16ca50d622)
  • Current main lacks the formatter floor: Current main has the shared SwiftFormat config but no --min-version and no disables for the three SwiftFormat 0.62.1 rules added by the PR. (config/swiftformat:3, bb16ca50d622)
  • Current Apple lanes consume the shared config: The macOS Swift lane runs swiftformat with config/swiftformat, and the iOS XcodeGen pre-build script also runs swiftformat with the same shared config. (.github/workflows/ci.yml:1897, bb16ca50d622)
  • Current CI routing is one-sided for Swift config: On current main, config/swiftformat and config/swiftlint.yml are included in IOS_BUILD_RE, while the macOS scope regex does not include those shared config files. (scripts/ci-changed-scope.mjs:41, bb16ca50d622)
  • PR adds the focused SwiftFormat contract: The PR adds --min-version 0.62.1 and disables wrapIfStatementBodies, wrapIfExpressionBodies, and redundantSwiftUIGroup instead of reformatting the Apple source tree. (config/swiftformat:3, 7d1da4133773)
  • Upstream SwiftFormat contract checked: SwiftFormat 0.62.1 upstream docs list the three rule names, and its README documents --min-version as a project config argument that fails older formatter versions.

Likely related people:

  • steipete: He authored this PR, previously moved the Swift configs under config, and has recent merged work on CI and iOS build surfaces tied to the affected Apple tooling path. (role: Apple CI and iOS build owner; confidence: high; commits: e7bb5d6ddf50, 11dda0e5fd3c, 7d1da4133773; files: config/swiftformat, .github/workflows/ci.yml, apps/ios/project.yml)
  • vincentkoc: Recent GitHub file history shows multiple commits in scripts/ci-changed-scope.mjs and Apple/native CI routing, including iOS build and mac packaging preflight routing. (role: recent CI routing contributor; confidence: medium; commits: cc981f8a7303, d71a24f3a4b7, 1479078a25e9; files: scripts/ci-changed-scope.mjs, .github/workflows/ci.yml, .github/workflows/ios-periphery.yml)
  • kklouzal: Current checkout blame for the touched workflow, Swift config, and CI scope lines points at a recent merged PR authored by kklouzal, though the local history is shallow so this is a weaker routing hint. (role: recent current-main area contributor; confidence: low; commits: 2e160718d4b7; files: scripts/ci-changed-scope.mjs, .github/workflows/ci.yml, config/swiftformat)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-09T20:34:30.989Z sha 7d1da41 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 9, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 7d1da4133773d3725dedfc16290f8fb42ebf3c86:

  • Maintainer decision: keep the repository's existing Homebrew-latest policy. The shared config now requires 0.62.1 and explicitly opts out of the three new defaults that conflict with established style; an exact SwiftFormat artifact pin is not needed for this fix.
  • CI run 29048019042: success. macos-swift upgraded SwiftFormat and passed the exact repository lint command; ios-build also passed.
  • iOS Periphery run 29048019106: success after the same SwiftFormat upgrade path.
  • Local SwiftFormat 0.62.1 exact CI lint: 0/264 files require formatting, 2 files skipped.
  • Local pnpm ios:build: success, including the always-run SwiftFormat phase; Xcode build completed in 226.984 seconds.
  • Blacksmith Testbox tbx_01kx46qbdxwxt2x7zqy5ee8acv: pnpm test src/scripts/ci-changed-scope.test.ts, 30/30 passed.
  • Fresh autoreview: no accepted or actionable findings. scripts/pr review-validate-artifacts 103098 and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103098 both passed.

Known proof gaps: none.

@steipete
steipete merged commit 129e279 into main Jul 9, 2026
159 of 168 checks passed
@steipete
steipete deleted the codex/fix-swiftformat-062-lint-drift branch July 9, 2026 20:48
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant