Repository navigation
style: format with swift-format and check it in CI - #133
Merged
Merged
Conversation
Apple's defaults, with the 4-space indentation the code already uses and a 150-character line length.
Generated by xcrun swift-format format -i -r -p . with the new config, plus one forEach turned into a for loop in FakeLocationProvider, the only warning the formatter can't fix itself.
A Format job runs swift-format lint --strict on every push and PR to main. AGENTS.md tells contributors and agents to format before committing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds swift-format, which ships with Xcode, so there's no new dependency. The PR has three commits:
.swift-formatconfig: Apple's defaults, with the 4-space indentation the code already uses and a 150-character line length.forEachbecame aforloop by hand inFakeLocationProvider, the only warning the formatter can't fix itself.xcrun swift-format lint --strict(under a second) on every push and PR tomain.AGENTS.mdnow says to format before committing. In Xcode, Editor › Structure › Format File with swift-format uses the same config.Verified:
forloop change, the reformatted code passed all 904 unit tests locally. This PR's CI runs them again with that change.After merge:
.git-blame-ignore-revsfile listing the squash commit, sogit blameand GitHub skip the reformat. Its hash only exists once this is merged.mainruleset's required checks. Doing it now would block open PRs whose branches don't have the job yet.Rebasing open branches onto this: keep your side of any conflict, then run
xcrun swift-format format -i -r -p ..Co-authored-by: Claude Code (Claude Opus 5.5)