← Back to PRs

#12121: Fix Swift formatting issues across codebase

by PythonUser42 open 2026-02-08 21:51 View on GitHub →
app: macos stale size: XL
## 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