#12121: Fix Swift formatting issues across codebase
app: macos
stale
size: XL
Cluster:
Cross-Platform Fixes
## Summary
Run `swiftformat` to fix formatting violations in 100 Swift files. This resolves the Swift lint CI failures that have been affecting all PRs.
## Changes
- Sort import statements alphabetically
- Fix indentation and trailing spaces
- Update property and function body wrapping
- Apply Swift 6 environment entry patterns
- Fix redundant ViewBuilder attributes
- Correct doc comment formatting
## Testing
- ✅ SwiftLint passes (4 warnings only, no errors)
- ✅ SwiftFormat passes with no violations
- ✅ All 100 files formatted successfully
## Impact
This PR will fix the failing Swift lint checks on:
- PR #11421 (format-duration tests)
- PR #11415 (package.json metadata)
- Any other PRs affected by Swift formatting issues
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR applies automated `swiftformat` changes across ~100 macOS Swift files to resolve formatting/lint violations (import ordering, whitespace/indentation, wrapping, and minor syntax rewrites).
Most changes appear mechanical, but there is at least one non-formatting rewrite in the protocol models that alters Swift syntax and will break compilation.
<h3>Confidence Score: 2/5</h3>
- Not safe to merge until a compile-breaking syntax change is reverted/fixed.
- Although the PR is intended to be formatting-only, `apps/macos/Sources/OpenClawProtocol/GatewayModels.swift` contains a rewrite to `self = try .req(...)` in `GatewayFrame.init(from:)` that is not valid Swift and should fail compilation. After correcting that, the remaining changes look mechanical and lower risk.
- apps/macos/Sources/OpenClawProtocol/GatewayModels.swift
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#10744: fix: update stale MoltbotProtocol paths to OpenClawProtocol
by marezgui · 2026-02-06
81.8%
#6596: Fix pre-existing formatting issues causing CI failures
by ryancnelson · 2026-02-01
75.4%
#8800: chore: apply oxfmt formatting
by shamsulalam1114 · 2026-02-04
74.8%
#5884: fix: curly lint errors and formal conformance fork permissions
by codearranger · 2026-02-01
74.2%
#3337: fix(macos-app): patch SwiftPM Bundle.module accessor for app bundle
by skymoore · 2026-01-28
73.1%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
72.5%
#22383: Chore: apply oxfmt baseline for CI check
by bmendonca3 · 2026-02-21
72.5%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
72.3%
#11980: CLI: add external message lint + warn on tables/mentions
by moestradamos · 2026-02-08
72.0%
#23762: docs: fix markdown formatting and structure issues
by jainilDesai · 2026-02-22
71.7%