- 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