SwiftFormat new has a website: swiftformat.info! Rules documentation is now available at swiftformat.info/rules.
- Added
redundantSwiftUIGrouprule - Added
preferContainsrule - Added
preferMinOverSortedrule - Added
preferFlatMaprule - Added
preferFirstWhererule - Added
--indent-blank-linesoption to match the surrounding context - Added
--line-wrap-thresholdoption for length-based wrapping - Added
--type-blank-lines consistentoption - Added
start-onlyandend-onlyvalues to--type-blank-lines - Added
before-non-local-declarationsvalue for--doc-comments - Enabled
isEmptyrule by default - Split
wrapConditionalBodiesintowrapIfStatementBodies,wrapIfExpressionBodies,wrapGuardStatementBodies - Updated
noGuardInTestsrule to apply to guard-like if statements, usetry #requirefor boolean conditions - Updated
redundantSendablerule to be disabled by default, and to skip enums with indirect cases - Fixed
redundantVariableincorrectly removing variables with modifiers or attributes - Fixed
preferSwiftTestingspuriously addingUIKitimport forUInttypes - Fixed
$nameclosure parameters incorrectly treated as unused whenselfhas a same-named property - Fixed
docCommentsrule incorrectly converting enum case group comments to doc comments - Fixed
markTypesincorrectly considering top-level macro declarations - Fixed
blankLinesBetweenScopesincorrectly inserting blank line before#elseifdirectives - Fixed
emptyExtensionsincorrectly removing extensions containing a freestanding macro declaration - Fixed
organizeDeclarationsincorrectly placing freestanding macro declarations afterMARKcomments - Fixed false positive
redundantSendableforindirect enum - Fixed
spaceAroundParensincorrectly inserting space beforeOptional.some(...)in subsequent@Testarguments