github nicklockwood/SwiftFormat 0.54.0

18 days ago
  • 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 redundant Never or any 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 returning nil instead of asserting in unavailable init?(coder:)
  • The fileHeader rule now uses git info for created date (if available) instead of file system
  • Added git author, author.name and author.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 whether redundantNilInit adds or removes explicit nil
  • Added ability to organize declarations by type over visibility (use --organizationmode type)
  • Fixed bug where enabling organizeDeclarations for structs caused sortDeclarations 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

Don't miss a new SwiftFormat release

NewReleases is sending notifications on new releases.