style: apply swiftformat wrapIfStatementBodies to main - #50
Open
arkavo-com wants to merge 1 commit into
Open
Conversation
`swiftformat --lint .` has been failing on main since the rule tightened in a newer swiftformat (reproduces on 0.63.0): 2/55 files, all in KASDiscovery.swift and TDF/TDFCBORFormat.swift. The last green lint run was #48 under an older binary, so every PR since has carried a red X unrelated to its own diff. Applies `swiftformat .` verbatim, plus one manual touch-up: wrapping the single-line `if` bodies in isBlockedV4/isBlockedIP left their CIDR comments dangling after the closing brace (`} // 10.0.0.0/8`), so those comments move above their `if` instead. Comment movement only, no condition or control-flow change. No logic changes. swift build and swift test pass; `swiftformat --lint .` now reports 0/55 files requiring formatting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fob1ho6LWHE6tddJJWaCrP
CI failed: CI failure in the Swift integration tests caused by formatting or compilation issues introduced when applying swiftformat wrapIfStatementBodies rules.Overview1 log error pattern analyzed indicating a build or test failure in the xtest workflow step during SDK/SDK-to-platform integration tests after applying swiftformat updates. FailuresSwift SDK Build / Test Failure (confidence: medium)
Summary
Code Review ✅ ApprovedApplies Tip Comment Was this helpful? React with 👍 / 👎 | Gitar |
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.
Summary
swiftformat --lint .has been failing onmainsince thewrapIfStatementBodiesrule tightened in a newer swiftformat (reproduces locally on 0.63.0). The failure is 2/55 files, entirely inKASDiscovery.swiftandTDF/TDFCBORFormat.swift.The last green
lintrun was #48, under an older swiftformat binary. Every PR since — including #49, which was markdown-only — has carried a red X that had nothing to do with its own diff. This clears it.What changed
swiftformat .applied verbatim (the repo's.swiftformatalready pins--swiftversion 6.2, so a local run matches the CI invocation exactly).ifbodies inisBlockedV4/isBlockedIPleft the CIDR comments dangling after the closing brace (} // 10.0.0.0/8), which reads worse than the original. Those comments move above theirifinstead. Comment placement only — no condition or control-flow change to the SSRF blocklist.No logic changes anywhere.
Verification
swiftformat --lint .→0/55 files require formatting(was 2/55)swift build→ cleanswift test→ exit 0, "All tests passed"Alternative considered
Adding
--disable wrapIfStatementBodiesto.swiftformatwould also make CI green and would preserve the more compactif cond { return true }early-return style, which is arguably more readable for a blocklist. Applying the rule was chosen instead so the repo stays on stock swiftformat defaults — happy to flip to the disable if you'd rather keep the one-liners.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fob1ho6LWHE6tddJJWaCrP