Skip to content

SwiftFormat for Xcode Release Notes

Nick Lockwood · An Xcode source editor extension for reformatting Swift code from the Editor menu.

CaskDeveloper Tools 9K
Install command
brew install --cask swiftformat-for-xcode
30-day installs
316
#532 in App
1-year installs
2.5K
Last 365 days
Latest version
0.64.7
Download size
10MB
zip
Release cadence
Weekly
6 releases in 30 days
  1. 0.64.7

    LatestPatch

    OpenNavo editorial Added to Homebrew

    SwiftFormat for Xcode 0.64.7 adds spelling options and fixes rules that crashed or rewrote Swift incorrectly.

    SwiftFormat for Xcode 0.64.7, released on November 14, 2026, adds spelling options to commonTypos and fixes rules that crashed or changed Swift code incorrectly. Source: https://github.com/nicklockwood/SwiftFormat/releases/tag/0.64.7

    • commonTypos gains --prefer-us-spelling and --preserve-iff.
    • hoistTry and hoistAwait no longer fail to finish on deep nesting.
    • Negative integer shifts no longer crash the tokenizer.
    • preferKeyPath no longer emits invalid code inside #expect and #require.
    • forWhere no longer changes precedence when joining conditions with &&.
    • unusedArguments no longer crashes on lifetime attributes without arguments.
  2. 0.64.6

    Patch

    OpenNavo editorial Added to Homebrew

    Fixes parsing of value generics and rules that rewrote valid Swift.

    SwiftFormat for Xcode 0.64.6 was released on 2026-11-06. This update fixes parsing of value generics, tuple pack expansions, and several rules that rewrote valid Swift.

    • Fixed parsing of value generic parameters, negative integer arguments, integer constraints, and inline-array types.
    • Fixed opaqueGenericParameters and simplifyGenericConstraints producing invalid code when formatting value generics.
    • Updated redundantSelf to preserve self in Logger calls by default, and made --self-required extend the default list.
    • Fixed organizeDeclarations and docComments separating conditional attributes and documentation from their declarations.
    • Fixed custom prefix / operators being mistaken for regex literals and causing incorrect lint line numbers.
    • Fixed parsing of tuple types containing parameter pack expansions.
    • Fixed Xcode-style indentation of wrapped type conformances.
    • Fixed preferSwiftTesting converting XCTest cases with conditionally compiled overrides or references to Swift Testing type names.
    • Updated test suite rules to preserve open classes that may be subclassed.
    • Fixed singlePropertyPerLine splitting tuple destructuring when the value count does not match.
    • Fixed redundantSendable removing Sendable from @usableFromInline types.
    • Fixed redundantClosure removing trailing closure arguments followed by a call.
    • Fixed handling of unsafe expressions in braces, redundantClosure, redundantParens, and unusedArguments.
    • Fixed numberFormatting grouping digits in availability version numbers.
    • Fixed trailingCommas adding commas to #warning, #error, and other directives.
    • Fixed hoistTry and hoistAwait joining keywords to preceding keywords.
    • Fixed yodaConditions corrupting comparisons wrapped after the operator or containing macro calls.
    • Fixed redundantInit removing .init when a function parameter shadows the type name.
    • Fixed redundantBackticks removing required backticks from type members named Protocol.
    • Fixed opaqueGenericParameters introducing some inside generic arguments of closure typealiases.
    • Fixed redundantParens removing required parentheses around optional opaque protocol compositions.
    • Fixed extensionAccessControl hoisting fileprivate onto extensions of private types.
    • Fixed duplicateImports removing imports with different SPI names.
    • Fixed preferExplicitFalse breaking parenthesized conditional compilation conditions.
    • Fixed preferLazyMap making closures that capture inout values escape.

    Source: https://github.com/nicklockwood/SwiftFormat/releases/tag/0.64.6

  3. 0.64.5

    Patch

    OpenNavo editorial Added to Homebrew

    SwiftFormat for Xcode 0.64.5 fixes rule edge cases in config matching, parsing and several format rules.

    SwiftFormat for Xcode 0.64.5 was released on 2026-10-31, fixing rule edge cases in config matching, parsing and several format rules.

    • Filtered config sections no longer apply to files that do not match, and matching sections apply in order.
    • Improved handling of unsafe in for loops and of expression parsing.
    • unusedArguments no longer removes arguments referenced by lifetime attributes.
    • redundantEquatable no longer removes == when stored properties are conditionally compiled.
    • preferForLoop no longer converts forEach calls used as expressions.
    • noForceUnwrapInTests no longer converts force unwraps inside key paths.
    • hoistTry, environmentEntry, braces, redundantClosure, redundantReturn, extensionAttributes and docComments fix placement, indentation and trailing-space bugs.
    • duplicateImports now removes ordinary duplicate imports across code boundaries.
  4. 0.64.4

    Expand

    OpenNavo editorial Added to Homebrew

    Fixes redundant-return removal in throwing branches, nested if flattening and command-line path handling.

    SwiftFormat for Xcode 0.64.4 was released on 2026-10-27 with four fixes to the formatting rules and the command line.

    • redundantReturn no longer removes a return that is still required when every branch of a nested conditional throws.
    • nestedIf now flattens nested else { if ... } branches into else if chains.
    • The command line handles paths that follow the -- end-of-options separator.
    • CLI warning tests no longer hang waiting for standard input when they run on their own.
  5. 0.64.3

    Expand

    OpenNavo editorial Added to Homebrew

    Fixes andOperator inside ternary branches and trailingClosures attaching closures from the next line.

    SwiftFormat for Xcode 0.64.3 was released on 2026-10-26 with two rule fixes.

    • andOperator no longer replaces && with commas inside the branches of a ternary expression.
    • trailingClosures no longer attaches a parenthesized closure that sits on a new line to the preceding statement.
  6. 0.64.2

    Expand

    GitHub Release Added to Homebrew

    • Fixed severe indent performance regression on large arrays of multiline initializers
    • Improved handling of #if directives in single-expression bodies, including return removal and SwiftUI formatting
    • Fixed unreachable-code warnings when building JSON encoding code with newer Swift versions
    • Fixed Windows release build setup
  7. 0.64.1

    Expand

    OpenNavo editorial Added to Homebrew

    Fixes condition wrapping and indentation plus enum, property, return, self, overload and brace rules.

    Fixes nestedIf and repeatedGuard losing condition wrapping when merging statements. wrapArguments no longer wraps a condition list when line breaks occur only inside its clauses; wrapEnumCases handles cases declared after raw values.

    Fixes propertyTypes dropping .init before force unwraps or trailing closures, redundantReturn removing required bare returns in do throws(...) bodies, redundantSelf missing locals declared after trailing closures, and redundantOverload removing overloads in types declaring a conformance. Fixes braces moving an opening brace onto conditional-compilation directive lines. Improves multiline if/guard indentation and wrapping.

    https://github.com/nicklockwood/SwiftFormat/releases/tag/0.64.1

  8. 0.64.0

    Expand

    OpenNavo editorial Added to Homebrew

    Adds snapshot-based incremental formatting and new rules for nested ifs, repeated guards, unused enumeration indices and content builders. Improves formatting performance and preserves unchanged Xcode editor lines. Excludes .build, Build and DerivedData by default.

    Adds snapshot-based incremental formatting and new rules for nested ifs, repeated guards, unused enumeration indices and content builders. Improves formatting performance and preserves unchanged Xcode editor lines. Excludes .build, Build and DerivedData by default.

    Source

  9. 0.63.1

    Expand

    OpenNavo editorial Added to Homebrew

    Adds sorting and test-related options, updates the default convenience modifier order, fixes several formatting and rule-handling issues, and fixes building with Xcode 27.

    Added
    Added --locale for deterministic sorting.Added --boolean-guards-in-tests; it defaults to preserve.
    Changed
    Updated the default convenience modifier order to match Apple conventions.
    Fixed
    Fixed declaration and import sorting, whitespace, comments, and package imports.Fixed string API, multiline-string, and documentation-comment rule handling.Fixed test-name, indentation, Swift Testing, and hoistTry behavior.Fixed building the project with Xcode 27.

    SwiftFormat 0.63.1 adds the --locale option for deterministic sorting and --boolean-guards-in-tests, whose default is preserve. The default modifier order for convenience now follows Apple conventions.

    Fixes cover sortDeclarations handling of trailing whitespace and comments, preferSwiftStringAPI changing a replacingOccurrences call with an empty search string, and disable:next behavior in multiline strings. docComments no longer incorrectly converts nested function comments after executable code. swiftTestingTestCaseNames no longer removes unnamed-argument underscores or pluralizes acronyms. sortImports no longer treats package imports as unlabeled. Indentation fixes address wrapped function names and wrapped case patterns when --indent-case true is used. Other fixes prevent duplicate default suite attributes from preferSwiftTesting and correct hoistTry placement across infix expressions with trailing closures. The release also fixes building the project with Xcode 27.

    Source: https://github.com/nicklockwood/SwiftFormat/releases/tag/0.63.1

  10. 0.63.0

    Expand

    OpenNavo editorial Added to Homebrew

    Adds formatting rules and options, updates Swift syntax handling and rule reporting, and fixes issues across formatting rules and command-line options.

    Added
    Added ifExpressions, preferLazyMap, and redundantExtendedLifetime rules.Added <!-- no-format --> to disable formatting of Markdown code blocks.Warns when --enable is used for a rule already enabled by default.Added --redundant-optional-binding; default is same-name-only.
    Updated
    Changed --single-line-ternary default to convert.Updated rules for Swift syntax, types, and Swift Testing.Rule output distinguishes default, opt-in, and deprecated rules.
    Fixed
    Fixed formatting edge cases, including indentation and false positives.Fixed handling of module selectors, generics, and conditional compilation.Increased Linux release-build stack size to 1 MB.

    SwiftFormat 0.63.0 adds the ifExpressions, preferLazyMap, and redundantExtendedLifetime rules, plus the <!-- no-format --> HTML comment syntax for disabling formatting of Markdown code blocks. It adds --redundant-optional-binding, which defaults to same-name-only, and warns when --enable is used for a rule already enabled by default. The default for --single-line-ternary changes to convert, while --wrapstringinterpolation preserves its default. Rule output now distinguishes default, opt-in, and deprecated rules.

    Rule updates cover declaration ordering, autoclosure detection, additional ExpressibleByXLiteral types, optional bindings, URL macros, Swift Testing names, generic extensions, and compiler-generated Equatable and Hashable conformances. Fixes address formatting edge cases involving closures, conditionals, generics, module selectors, and indentation, as well as issues in several rules and options. Linux release builds now use a 1 MB stack.

    Source: SwiftFormat 0.63.0 release

  11. 0.62.1

    Expand

    OpenNavo editorial Added to Homebrew

    Several rules are now disabled by default. A new option configures `noGuardInTests`, and SwiftFormat has a new website with rule documentation.

    Rules
    Disabled by default: isEmpty, preferContains, preferFirstWhere.
    Options
    Added --guard-like-if-statements to noGuardInTests; default: preserve.
    Website
    New website: swiftformat.info, with rules documentation.

    SwiftFormat 0.62.1 disables several rules by default: isEmpty, preferContains, preferFirstWhere, preferCountWhere, preferMinOverSorted, and preferFlatMap.

    The noGuardInTests rule gains the --guard-like-if-statements option, which defaults to preserve.

    SwiftFormat also has a new website at swiftformat.info, where rule documentation is available at swiftformat.info/rules.

    • Also disabled by default: preferCountWhere, preferMinOverSorted, preferFlatMap.
  12. 0.62.0

    Expand

    GitHub Release Added to Homebrew

    SwiftFormat new has a website: swiftformat.info! Rules documentation is now available at swiftformat.info/rules.

    • Added redundantSwiftUIGroup rule
    • Added preferContains rule
    • Added preferMinOverSorted rule
    • Added preferFlatMap rule
    • Added preferFirstWhere rule
    • Enabled isEmpty rule by default
    • Split wrapConditionalBodies rule into wrapIfStatementBodies, wrapIfExpressionBodies, wrapGuardStatementBodies
    • Added --indent-blank-lines option to match the surrounding context
    • Added --line-wrap-threshold option for length-based wrapping
    • Added --type-blank-lines consistent option
    • Added start-only and end-only values to --type-blank-lines
    • Added before-non-local-declarations value for --doc-comments
    • Updated noGuardInTests rule to apply to guard-like if statements, use try #require for boolean conditions
    • Updated redundantSendable rule to be disabled by default, and to skip enums with indirect cases
    • Fixed redundantVariable incorrectly removing variables with modifiers or attributes
    • Fixed preferSwiftTesting spuriously adding UIKit import for UInt types
    • Fixed $name closure parameters incorrectly treated as unused when self has a same-named property
    • Fixed docComments rule incorrectly converting enum case group comments to doc comments
    • Fixed markTypes incorrectly considering top-level macro declarations
    • Fixed blankLinesBetweenScopes incorrectly inserting blank line before #elseif directives
    • Fixed emptyExtensions incorrectly removing extensions containing a freestanding macro declaration
    • Fixed organizeDeclarations incorrectly placing freestanding macro declarations after MARK comments
    • Fixed false positive redundantSendable for indirect enum
    • Fixed spaceAroundParens incorrectly inserting space before Optional.some(...) in subsequent @Test arguments
  13. 0.61.1

    Expand

    GitHub Release Added to Homebrew

    • Fixed race condition when parsing config files
    • Fixed redundantStaticSelf false positive inside closures and nested functions
    • Fixed unsafe keyword dot-spacing edge case
    • Fixed redundantSelf crash on switch expression inside if-let binding chain
    • Fixed redundantEquatable removing manual == for types with Any.Type stored properties
  14. 0.61.0

    Expand

    GitHub Release Added to Homebrew

    • Added wrapCaseBodies rule
    • Added redundantEmptyView rule
    • Added preferSwiftStringAPI rule
    • Added --test-case-access-control option for testSuiteAccessControl rule
    • Updated sortImports to support --import-grouping length,alpha
    • Updated --self-required to support assignment type names like OSLogMessage
    • Updated --suite-name-format default value to preserve
    • Fixed conditional import parsing with access modifiers
    • Fixed infinite loop in organizeDeclarations when opening brace has a trailing comment
    • Fixed closing brace indentation with --trimwhitespace nonblank-lines
    • Fixed indentation of multiline raw string literals with --indent-strings
    • Fixed redundantParens incorrectly removing () from @MainActor closure signatures
    • Fixed wrapping inside parens of function declarations with no parameters
    • Fixed extensionAccessControl incorrectly hoisting public onto extensions of nested internal types
    • Fixed spaceAroundParens incorrectly removing space after nonisolated(nonsending) modifier
    • Fixed noGuardInTests incorrectly transforming guard #available conditions
    • Fixed trailing comma for @convention closures
    • Fixed number handling in Swift Testing test case name conversion
    • Fixed redundantSelf inserting self. inside #if/#elseif compiler directive conditions
  15. 0.60.1

    Expand

    GitHub Release Added to Homebrew

    • Fixed issue where redundantSendable rule would unexpectedly remove Sendable conformance on type defined in public extension
    • Fixed issue where redundantSendable rule would leave behind extra space when removing :
    • Renamed redundantProperty rule to redundantVariable
    • Updated redundantVariable rule to preserve variables with explicit type annotations
    • Updated enumNamespaces rule to preserve Swift Testing suites as structs
  16. 0.60.0

    Expand

    GitHub Release Added to Homebrew

    • Added redundantSwiftTestingSuite rule
    • Added redundantSendable rule
    • Added preferExpicitFalse rule
    • Added support for :: module selector syntax
    • Added support for value generics syntax
    • Updated swiftTestingTestCaseNames to use raw identifiers by default
    • Updated swiftTestingTestCaseNames to use UpperCamelCase for test suite names
    • Updated redundantSelf to handle guard statements
    • Updated unusedArguments to handle for loop variables
    • Updated redundantType to better handle Set literals
    • Updated redundantParents to remove empty parens from attributes
    • Updated sortImports to sort imports by access control
    • Updated blankLinesBetweenImports to preserve indentation when indent disabled
    • Updated unusedPrivateDeclaration rule to preserve private @Test functions
    • Updated preferSwiftTesting rule to convert tests in extensions within the same file
    • Updated --stdin-path to not require the file to actually exist
    • Updated simplifyGenericConstraints to avoid adding duplicate constraints
    • Updated blankLinesAroundMark to insert blank line before MARK at start of scope when allowed by blankLinesAtStartOfScope config
    • Updated redundantEquatable to preserve == implementation in types with Strideable conformance
    • Fixed handling of switch statements with #if blocks in several rules
    • Fixed issue where async function declarations were wrapped using wrapArguments instead of wrapParameters
    • Fixed issue where redudantViewBuilder would remove @ViewBuilder from protocol members
    • Fixed redundantSelf parsing issue with throwing closure return types and switch expressions in if let condition
    • Fixed trailingCommas rule incorrectly adding commas to if #available checks
    • Fixed guard...else indentation in wrapArguments with wrap-conditions
    • Fixed issue where simplifyGenericConstraints would leave dangling where keyword in protocol members
    • Fixed issue where trailingCommas didn't handle closure capture lists with macro expressions
    • Fixed indentation for closure parameters on separate lines
    • Fixed issue where .init would be removed in code like [Foo].init { ... } (not supported until Swift 6.4).
    • Fixed issue where .swift-version files were read from excluded directories
    • Fixed incorrect replacement of && operator with , inside a ternary condition
    • Fixed unusedArguments bug in code with try? await
    • Fixed handling of MainActor attributes in redundantViewBuilder
  17. 0.59.1

    Expand

    GitHub Release Added to Homebrew

    • Reverted changes to indent rule --ifdef handling from 0.59.0
    • Updated docComments rule to use doc comments on nested functions and handle conditional compilation blocks in function bodies
    • Updated spaceAroundBrackets to preserve space between global actor attribute and closure capture list
    • Updated redundantMemberwiseInit to preserve inits with attributes
    • Fixed handling of any keyword in sortTypealiases rule
    • Resolved build issue related to macOS 13 SDK availability
  18. 0.59.0

    Expand

    GitHub Release Added to Homebrew

    • Added simplifyGenericConstraints rule
    • Added validateTestCases rule
    • Added testSuiteAccessControl rule
    • Added wrapPropertyBodies rule
    • Added wrapFunctionBodies rule
    • Added redundantViewBuilder rule
    • Added --ifdef preserve option to indent rule
    • Added --prefer-synthesized-init-for-internal-structs option to redundantMemberwiseInit rule
    • Enabled more rules by default: blankLinesBetweenImports, docComments, emptyExtensions, environmentEntry, noForceTryInTests, noForceUnwrapInTests, redundantAsync, redundantEquatable, redundantMemberwiseInit, redundantProperty, redundantThrows
    • Updated typeSugar to only preserve explicit Optional<T> in structs with a synthesized memberwise initializer
    • Updated closing paren of single-argument functions and collections to wrap if needed
    • Updated redundantMemberwiseInit rule to support result builder attributes
    • Improved how organizeDeclarations handles structs with a synthesized memberwise initializer
    • Updated docComments rule to preserve formatting of comments with directives
    • Fixed --ifdef no-indent handling of method chains and nested directives
    • Fixed issue where XMLReporter did not properly escape strings
    • Fixed support for unsafe keyword
    • Fixed edge cases in spaceAroundBrackets rule
    • Fixed crash in sortTypealiases rule
    • Fixed issue where redundantSelf rule could crash if encountering a function with no body (e.g.@_silgen_name)
  19. 0.58.7

    Expand

    GitHub Release Added to Homebrew

    • Fixed redundantSelf not being applied inside if #available(...) { ... } clauses
    • Fixed fileHeader rule incorrectly setting creation year to current when file path contains spaces
    • Fixed mis-insertion for nil-init rule related to optional closure return values
    • Fixed unusedPrivateDeclarations false positive when call site was outside enabled range
    • Fixed sortImports rule incorrectly moving // swift-tools-version: comment directive
    • Fixed hoistTry rule sometimes producing mangled code when hoisting across line boundaries
    • Fixed crash in --ruleinfo command when rule options exceed the old max length requirement
    • Fixed crash in unusedArguments due to scope range bug
  20. 0.58.6

    Expand

    GitHub Release Added to Homebrew

    • Fixed docComments not being applied correctly after conditional switch...case
    • Trailing commas are no longer inserted inside #selector(...) expressions
    • Source files listed with --filelist are now formatted concurrently
    • Trailing comments are now kept with the same line when wrapping
    • Fixed spurious return removal inside repeat...while loops
    • Fixed bug with trailingClosures rule and property wrappers
    • Fixed performance regression introduced in 0.58.5
    • Reduced timeout threshold to 1ms per token
  21. 0.58.5

    Expand

    GitHub Release Added to Homebrew

    • Fixed regression with indenting of macros (introduced in 0.58.4)
    • Fixed spurious removal of return keyword inside for ... where loops
    • Fixed parsing error with for await case ... loops
    • Added XCTUnwrap to the default exclusion list for hoistTry
  22. 0.58.4

    Expand

    GitHub Release Added to Homebrew

    • Whitespace is no longer added or removed from blank lines in multiline string literals
    • Fixed trailingComma rule incorrectly inserting commas inside typed throws
    • Fixed issue where opaqueGenericParameters rule could cause build errors with existential types
    • Fixed false positive with unusedArguments when argument is only referenced inside a macro
    • The noGuardInTests rule now preserves custom failure messages
    • The noGuardInTests rule no longer adds throws to test methods when not needed
    • Removed redundant "default" values from options help descriptions
  23. 0.58.3

    Expand

    GitHub Release Added to Homebrew

    • Fixed parsing of [n of X] syntax for InlineArray in Swift 6.2
    • Fixed parsing error when an opening multiline string delimiter is followed by a space
    • Fixed issue where redundantInit rule could leave orphaned parentheses
    • Fixed bug where redundantInit was incorrectly applied to (Foo.self as Bar.Type) expressions
    • Fixed bug with parsing empty property accessors that broke redundantSelf rule
    • Fixed aliasing issue with acronyms rule where one acronym overlaps another
    • Fixed unexpected wrapping of closing parenthesis in wrapArguments rule
    • Added --unknown-rules option to support environments with older SwiftFormat versions
  24. 0.58.2

    Expand

    GitHub Release Added to Homebrew

    • Fixed issue where modifierOrder rule confused async effect for async modifier
    • Fixed issue where testing related rules incorrectly treated functions with arguments as test cases
    • Updated redundantInit rule to apply to init calls with single trailing closure
    • Updated README.md to reflect actual precedence behavior between .swift-version files and --swift-version arguments