- Added
--snapshotfeature for incrementally adopting formatting without changing files that match a saved snapshot - Added
--unknown-options error|warn|ignorefor handling unknown rules, options, and unsupported option values - Added
--color auto|always|neverto control colored command-line output - Added
nestedIfrule to merge nested if statements - Added
repeatedGuardrule to merge consecutive guard statements with identical bodies - Added
redundantEnumeratedrule to remove unused enumeration indices from for loops - Added
extensionAttributesrule to hoist common member attributes onto extensions - Added
contentBuilderrule, replacingredundantViewBuilder, with--content-builderand--prefer-content-builderoptions - Added
commonTyposrule, with--typo-visibility,--typos, and--ignore-typosoptions - Added
forWhererule with--for-where always|never - Added
redundantOverloadrule to replace forwarding overloads with default arguments - Added
preferStructSwiftTestingSuitesrule - Added
wrapClosureBodies,wrapDoBodies, andwrapSingleLineStringsrules - Added
header-creation-date-after:config filters for applying rules based on file header dates - Added
--scope-blank-lines remove|preservefor function bodies, closures, and statement blocks - Added
--wrap-single-line-enum-casesoption, defaulting tofalse - Added
--acronym-visibilityoption, defaulting tointernal - Added
--blank-line-after-switch-case neveroption - Added
--hoist-imports hoist|preserveoption, defaulting tohoist - Added
--excluded-declaration-typesoption for thedocCommentsrule - Added
attributes-lastimport grouping and made import grouping order configurable - Added support for sorting array and dictionary literals with
swiftformat:sortdirectives - Updated SwiftUI rules to support
@ContentBuilder - Updated
redundantExtendedLifetimeto handle write-only references and underscored assignments - Updated
redundantParensto handle optional opaque types in Swift 6.4 - Updated
noForceUnwrapInTeststo handle force unwraps on the RHS of operators and placetryat the start of the expression - Renamed
privateStateVariablestoprivateSwiftUIDynamicPropertiesand expanded it to other SwiftUI dynamic properties in views and view modifiers - Fixed
noForceUnwrapInTestsusing stale function body ranges and placingtrybefore assignment targets - Fixed indentation of multiline conditions, method chains, closures, and wrapped case patterns
- Fixed
redundantSelfandredundantStaticSelfmodifying code outside the requested line range - Fixed
redundantReturnremoving required returns before expressions in Void functions - Fixed formatting of
readandmodifyaccessors - Fixed directive handling performance with multiline strings
- Fixed
organizeDeclarationstimeouts when declarations share a line - Fixed crash in
organizeDeclarationsrule when opening brace line has a trailing comment - Improved formatting performance and reduced repeated parsing and configuration work
- Preserved unchanged editor lines when formatting in Xcode
- SwiftFormat now excludes
.build,Build, andDerivedDatadirectories from formatting/linting by default - Removed CocoaPods distribution and the prebuilt binary from the repository (use Swift Package Manager or release downloads instead)