Skip to content

Releases: toba/swiftiomatic

v3.14.9

23 Jun 16:52

Choose a tag to compare

  • fix absolute exclude patterns silently failing under macOS /private firmlinks

v3.14.8

20 Jun 20:13

Choose a tag to compare

  • fix formatter stranding trailing commas (, ), )) when collapsing a nested call passed as the sole argument of an outer call (built.append(try Thing(...))). The brm-7t3 isSoleCallArgumentOfOuterCall path sets ignoreDiscretionary to collapse the inner call with its parent, but the closing-paren break was elective (so ) hugged the last argument when only partially collapsed) and the user's trailing commas were emitted verbatim under keptAsWritten + non-collection — falling through to commaDelimitedRegionEnd's unconditional else-if-hasTrailingComma branch. Three coordinated fixes: (1) arrangeFunctionCallArgumentList now forces .close(mustBreak:) when ignoreDiscretionary is in effect and the last argument carries a trailing comma (excluding array/dict/closure compact args, which keep hugging ]) / }) ), making the collapse all-or-nothing — fits on one line, or stays wrapped with ) on its own line so each comma is followed by a newline; gated on a trailing comma so the common no-comma case still hugs (for: absolute)) ). (2) LayoutCoordinator's keptAsWritten/non-collection comma-region branch now only writes the preserved comma while the region is still multiline, dropping the stray comma on a single-line collapse (whitespace-only mode unchanged). (3) the .break(.same) after the last argument's trailing comma uses size 0, removing the residual space before ) (b: 2 )) without affecting newline behavior. Adds regression tests nestedCallCollapseDoesNotStrandTrailingCommas / nestedCallFullCollapseDropsTrailingComma; full suite green (3466 passed); output idempotent (2q7-lql / #739)

v3.14.7

20 Jun 15:43

Choose a tag to compare

  • fix nestedCallLayout inline mode expanding a SwiftUI modifier-chain call argument instead of inlining it; when the outer call is a modifier-chain element its calledExpression is the whole multiline chain (Text(name)…onHover{…}.background), so the inline strategies mis-measured — calledExpression.trimmedDescription carried the chain's newlines and columnOffset/lineIndentation anchored on the chain root (Text, col 8) rather than the modifier segment (.background, col 12) — making every inline strategy look too wide and falling through to Strategy 3, which expands the call. transform now detects a multiline callee (calleeSpansMultipleLines) and routes such calls away from the chain-rebuild strategies into tryInlineModifierCallArgument, which collapses the argument list inline (collapseCallArguments) when the .method(args) segment fits at its real rendered column (anchored on the member-access period); bails on trailing closures, comments, an already-inline body, a non-member-access callee, or a segment that wouldn't fit, and anchors the finding on the modifier name. wrap mode (and non-member-access multiline callees) now leave the call unchanged instead of mangling it. Adds regression tests modifierChainCallArgumentCollapsesInline / modifierChainCallArgumentAlreadyInlineUnchanged; full suite green (3464 passed); verified end-to-end on the real thesis FontPicker.swift with nestedCallLayout: inline (prs-zf4 / #738)

v3.14.6

20 Jun 03:01

Choose a tag to compare

  • fix assignment RHS member chain wrapped in a binary op (chain.max() ?? 1) breaking after = when already wrapped at its dots; the base should stay on the = line. shouldRetargetChainHeadCloseForAssignmentRHS only walked up through assignment operators, so for a chain that is the left operand of a non-assignment infix (??) the walk stopped at the InfixOperatorExpr and returned false; the chain head's .open group then closed after children.filter instead of after the base children, inflating the = break's chunk to span the whole chain (token-stream Length 116 vs 4 for a pure chain) so the forced inner dot-breaks dragged the = break along. Now the walk treats a non-assignment infix as transparent when the chain is its left operand and keeps climbing to find the enclosing assignment/binding, so the head group closes after the base and the = break stays bounded. Adds regression test assignmentChainWithNilCoalescingKeepsBaseOnEqualLine; full suite green (3462 passed); verified end-to-end on the real thesis MockNode.swift at lineLength 100 (gl8-vhc / #737)

v3.14.5

19 Jun 15:55

Choose a tag to compare

  • fix SortImports dropping a shebang's trailing newline when reordering imports (port swift-format #1207); SortImports.visit(_:) now restores the shebang's leading newlines after reordering, gated on node.shebang != nil and a leadingNewlineCount before/after comparison, so the file header or first import no longer gets pulled up onto the #! line; adds leadingNewlineCount(of:) helper and regression tests shebangWithFileHeaderAndImport / shebangWithReorderedImports (egt-9i9 / #736)

v3.14.4

18 Jun 20:39

Choose a tag to compare

  • fix member-access chain after a lone closing delimiter wrongly indenting as a continuation (regression from c3de9ab / on8-mme); a .-chain continuing a base whose closing brace/paren — or a postfix-#if's #endif — sits alone on its own line (SwiftUI trailing-closure calls like Button { … } label: { … } / HStack { … }, an arg list whose ) was forced onto its own line, an array literal, a postfix-#if) now stays flush with that delimiter instead of indenting; chains continuing a base whose delimiter sits inline after wrapped arguments (OuterView(…)) ) still indent as the on8-mme change intended. Replaces the unconditional .maintain=true flip with a baseEndsAloneOnLine() check (inspects whether the base's last rendered line is just closing delimiters / #endif), resolved once per breaking-context scope and stored on ActiveBreakingContext so every chain element agrees — including a chain that continues past a postfix-#if whose outer context resolves late; the on8-mme binding boost is gated on the same check. Reverts the 7 expectations c3de9ab changed back to upstream flush across MemberAccessExprTests/IfConfigTests (restoring postfixPoundIfNotIndentedIfClosingParenOnOwnLine)/FunctionCallTests; adds regression test chainAfterLoneClosingBraceStaysFlush; multilineBaseChainIndentsAsContinuation still passes; full suite green (3459 passed) (m2x-4bl)

v3.14.3

18 Jun 17:43

Choose a tag to compare

  • indent member-access chains that continue a multiline base instead of leaving them flush with the statement keyword; a .-chain after a wrapped base call (e.g. .padding()/.background() after OuterView(…)) now indents as a continuation — one level for a bare expression, two for a chain bound by return/throw/assignment — via a flip of the contextual .maintain case plus a leftmost-base-anchored boost scope (a real ActiveOpenBreak pushed only when the chain's leftmost base wraps), so single-line bases and chains nested inside arguments are unaffected and the indent never stair-steps; postfix-#if modifier chains now match the already-indented #if-after-modifier case; boost emission factored into a shared bracketMultilineChainBoost helper; adds regression test multilineBaseChainIndentsAsContinuation and updates 7 existing expectations that encoded the old upstream flush behavior; deliberate divergence from upstream swift-format; full suite green (3458 passed) (on8-mme)

v3.14.2

18 Jun 02:52

Choose a tag to compare

  • fix #if-wrapped switch case double-indent under indentConditionalCompilationBlocks; visitIfConfigClause now uses .same breaks when the enclosing IfConfigDecl is a direct SwitchCaseList element, keeping the case flush with sibling cases while still indenting the case body and normal non-switch #if blocks; add deferred bhi-jt9 for the lone-closing-brace closure layout with a quick-remind anchor comment in visitClosureExpr

v3.14.1

17 Jun 01:47

Choose a tag to compare

  • fix guard else placement: re-attach inline else { stmt } to wrapped conditions when the whole inline form fits, drop it as a unit when it doesn't; hybrid that reverses the prior always-break behavior while preserving the deeply-nested non-fitting case

v3.14.0

12 Jun 15:32

Choose a tag to compare

  • add UseTypedNotificationName and UseTypedSystemNotification lint rules for pre-OS 26 NotificationCenter patterns; UseTypedNotificationName flags custom 'extension Notification.Name { … }' and 'Notification.Name("…")' / 'Notification.Name(rawValue:)' literal constructions in favor of typed 'NotificationCenter.MainActorMessage' (or 'AsyncMessage') structs; UseTypedSystemNotification flags 'addObserver(forName:)' / 'notifications(named:)' / 'messages(named:)' / 'post(name:)' uses of system notifications that ship a typed adapter on OS 26+, recognising both qualified 'Type.memberNotification' and bare-identifier Foundation forms; adapter allow-list generated from macOS + iOS 26.5 SDK swiftinterfaces by Scripts/generate-notification-adapters.sh (121 entries), supplemented by a hand-curated 17-entry table of free-floating Foundation NS* names that don't appear in swiftinterfaces; both rules are flag-only (no autofix) since the producer-side userInfo shape needed to synthesize the Message struct can't be inferred from a single call site; selector-based observer pattern was already covered by existing UseClosureNotificationObserver (95w-eow)