Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.54.2
- Fixed broken formatter cache, which caused a significant performance regression since 0.54.0
- The
blankLinesBetweenChainedFunctions
rule now removes blank line after comments in the chain - The
blankLinesBetweenChainedFunctions
rule no longer conflicts withblankLinesAroundMark
- Fixed
redundantInternal
removing requiredinternal
keyword in extensions withwhere
clause - Fixed another case of spurious
return
removal in conditional blocks - Fixed
redundantNilInit
rule insertingnil
afteras
keyword
0.54.1
- The
--nilInit insert
option is no longer applied to lazy or attributed properties - The
blankLinesBetweenChainedFunctions
rule now correctly handles comments in the chain - Fixed indenting of wrapped arguments in
--fragment
mode - Fixed bug where attributes were mistaken for an accessor in a computer property
- Fixed indenting of commented code after an opening bracket
- Fixed spurious removal of
return
in conditional blocks - Fixed
--lint
mode reporter output when usingstdin
0.54.0
- Added
blankLineAfterSwitchCase
rule for inserting blank lines after switch cases - Added
consistentSwitchCaseSpacing
rule for ensuring consistent spacing between switch cases - Added
redundantProperty
rule for removing variable assignments where value is immediately returned - Added
redundantTypedThrows
rule for stripping redundantNever
orany Error
throws
types - Setting
--report
without--reporter
type now raises an error if type can't be inferred - Added XML reporter for Checkstyle-compatible lint reporting (use the
--reporter xml
option) - Added
--typedelimiter
option for controlling spacing around the colon in type definitions - Added
--initcodernil
option for returningnil
instead of asserting in unavailableinit?(coder:)
- The
fileHeader
rule now uses git info forcreated
date (if available) instead of file system - Added git
author
,author.name
andauthor.email
tokens for file header templates - Added
--callsiteparen
option for controlling closing paren placement at function call sites - The
wrapAttributes
rule can now be applied differently to computed properties vs stored properties - The
wrapAttributes
rule can now be applied differently to complex (parameterized) vs simple attributes - Replaced
--varattributes
with--storedvarattrs
,--computedvarattrs
and--complexattrs
options - Added
—-nilinit
option for controlling whetherredundantNilInit
adds or removes explicitnil
- Added ability to organize declarations by type over visibility (use
--organizationmode type
) - Fixed bug where enabling
organizeDeclarations
for structs causedsortDeclarations
to have no effect - Fixed bug where if statement body could be incorrectly parsed as a trailing closure
- Improved attribute handling in
opaqueGenericParameters rule
- SwiftFormat now recognizes
init
and_modify
property accessors - Fixed bug with
preferForLoop
rule and tuple argument matching - Extended
conditionalAssignment
rule to handle more cases - Added
--condassignment after-property
option - Fixed await being hoisted outside of macro arguments
- Fixed unsafe adding/removal of
self
within macros - Added
os_log
to--selfrequired
defaults
0.53.10
- Fixed creation of spurious
stdout
directory when using--output stdout
- Fixed
unusedArguments
false positive for multiline function call arguments - Fixed parsing of generic arguments containing attributes or
~
operator - Fixed spurious errors about missing
--report
or--reporter
arguments - Fixed
strongifiedSelf
removing required backticks around nonisolatedself
- Deprecated explicit
default
value for--reporter
(introduced in 0.53.9) - Added support for
sending
keyword
0.53.9
- Fixed bug in
unusedArguments
when shadowing function argument with conditional assignment declaration - Individual
--lint
errors are no longer shown in--quiet
mode (restores pre-0.53.8 behavior)
0.53.8
- Added
--strict
option to emit non-zero exit code after applying changes in formatting mode - The
enumNamespaces
rule is no longer applied to structs with macros that have generic arguments - The
opaqueGenericParameters
rule is no longer applied to structs with macros or attributes - Fixed another case where
redundantParens
spuriously removed parens inside a closure - Fixed bug where
redundantInit
mishandled a.init
after a ternary operator
0.53.7
- Fixed bug with
redundantParens
where first parens inside a closure were spuriously removed - Fixed
wrapEnumCases
rule mangling unindented cases - The
wrapEnumCases
rule no longer wraps cases inside inline enum declarations - Improved the
redundantInit
metatype heuristic to reduce false positives
0.53.6
- Fixed bug where a space was incorrectly added before a
.
operator inside attribute arguments - The
redundantType
rule no longer strips required explicit type from@Model
class default values - Fixed issue where
redundantInit
didn't work on collection types - The
redundantParens
rule now correctly handles@MainActor
closures - Fixed bug where required parens were removed around
each X
parameter pack expressions - Fixed issue where
--wrapreturntype if-multiline
didn't work with arrays, dictionaries, tuples, or generic types - The
spaceAroundParens/Brackets
rules now correctly insert a space afterborrowing
/consuming
andisolated
- Fixed spurious line breaks inserted between scoped
import
statements - Added
--doccomments preserve
option to preserve all doc comments, even if not followed by a declaration
0.53.5
- Fixed bug with trailing comma being inserted into wrapped capture list
- Fixed bugs with parsing
nonisolated(unsafe)
modifiers - Fixed bug with hoisting
try
orasync
after a string literal expression - Fixed issue with parsing expressions containing generic arguments
- Lint warnings are now displayed as errors when not running in
--lenient
mode - Improved error message for unexpected
static
/class
modifiers - Added Swift 6.0 to list of supported Swift versions
0.53.4
- The
enumNamespaces
rule is no longer applied to structs with attributes or macros - The new
nonisolated(unsafe)
modifier is now handled correctly - Added support for
do throws(Type) { ... }
clauses