Skip to content

Releases: airbnb/swift

1.2.0

20 Dec 16:34
6c09dd5

Choose a tag to compare

What's Changed

  • Enable --allow-partial-wrapping false and --type-body-marks remove options by @calda in #328
  • Add autocorrect for "prefer final classes" rule by @calda in #329
  • Add rules to avoid force unwrap and redundant throws / async in tests by @calda in #330
  • Update SwiftFormat --swift-version to Swift 6.2 by @calda in #331
  • Add modifierOrder rule by @jqsilver in #332
  • Enable validateTestCases SwiftFormat rule by @calda in #333
  • Enable testSuiteAccessControl rule by @calda in #334
  • Add rule to convert where clause generic constraints to inline angle bracket constraints for simple protocol conformances by @mannylopez in #335
  • Add Format rules should be non-destructive by @swiftal64 in #337
  • Internal SwiftUI views should use synthesized memberwise initializer by @calda in #347
  • Clarify that SwiftUI synthesized init rule only applies to internal views by @calda in #350
  • Add redundantViewBuilder rule by @miguel-jimenez-0529 in #353
  • Add wrapSingleLineBodies by @mannylopez in #352

Full Changelog: 1.1.0...1.2.0

1.1.0

08 Aug 01:24
a702f58

Choose a tag to compare

What's Changed

  • Update no_release_standard_out lint rule to include SwiftUI _printChanges helper by @calda in #297
  • Update SwiftFormat to 0.56 beta 6 by @calda in #298
  • Add rule to avoid prefixing Swift Testing test case methods with "test" by @calda in #299
  • Update to SwiftFormat 0.56-beta-9 by @calda in #301
  • Remove unusedPrivateDeclarations rule by @mannylopez in #304
  • Update update:swiftformat to use nightly builds from calda/SwiftFormat-nightly repo by @calda in #307
  • Wrap multi-line function declarations before the last paren by @mike-at-home in #306
  • Match call-site paren on multi-line function calls by @mike-at-home in #308
  • Enable --wrapstringinterpolation preserve by @calda in #309
  • Add rule to keep modifiers on the same line as the rest of the declaration by @calda in #311
  • Add rule to avoid public access control in internal types by @calda in #310
  • add new proposed rule in new Testing section by @jqsilver in #313
  • add new rule to prefer throwing in tests over try! by @jqsilver in #314
  • Move "Swift Testing test case names" rule to new "Testing" section by @calda in #316
  • Enable autocorrect for "avoid guard in tests" rule by @calda in #315
  • Add RedundantMemberwiseInit rule by @miguel-jimenez-0529 in #318
  • Add urlMacro rule by @mannylopez in #317
  • Update SwiftFormat options to --kebab-case by @calda in #319
  • Add redundantTypedThrows SwiftFormat rule by @miguel-jimenez-0529 in #320
  • Add redundantBreak SwiftFormat rule by @miguel-jimenez-0529 in #322
  • Organize declarations in protocol bodies by @calda in #325
  • Add rule to only define a single property or enum case per line by @calda in #324
  • Organize declarations in struct bodies, but continue omitting MARK comments by @calda in #326
  • Update trailing commas rule to apply to all comma-separated lists by @calda in #323

Full Changelog: 1.0.8...1.1.0

1.0.8

03 Jan 20:12
c7e833f

Choose a tag to compare

What's Changed

  • Add rule to infer property types from the right-hand-side value rather than writing the type explicitly on the left-hand side by @calda in #263
  • Add rule to remove blank lines between chained functions by @mannylopez in #272
  • Add redundantProperty rule by @calda in #273
  • Remove Linux #error from Package.swift by @calda in #278
  • Add explicit category ordering configuration for organizeDeclarations rule by @calda in #280
  • Add rule to place doc comments before any attributes by @calda in #281
  • Add SwiftUI Property declaration to sub section ordering list by @miguel-jimenez-0529 in #282
  • Add emptyExtension rule by @mannylopez in #283
  • Add unusedPrivateDeclaration rule by @mannylopez in #284
  • Replace several autocorrectable SwiftLint rules with SwiftFormat rules by @calda in #287
  • Update infix operator spacing rule to clarify rule for operator definitions like static func ==(lhs: T, rhs: T) -> Bool by @calda in #286
  • Update colon spacing rule to apply to dictionary literals by @calda in #285
  • Add SwiftFormat void rule by @miguel-jimenez-0529 in #288
  • Add SwiftUI properties sort by @miguel-jimenez-0529 in #289
  • Remove reference to SwiftLint Void rule by @miguel-jimenez-0529 in #290
  • Add rule to prefer a generated Equatable implementation when possible by @calda in #292
  • Update SwiftFormat --swiftversion to 6.0 with --languagemode 5 by @calda in #291
  • Add rule to prefer a generated EnvironmentValue property implementation when possible by @miguel-jimenez-0529 in #293
  • Add rule to prefer count(where: { ... }) over filter { ... }.count by @calda in #295

Full Changelog: 1.0.7...1.0.8

1.0.7

06 May 17:29
fa3ae57

Choose a tag to compare

What's Changed

  • Update to SwiftFormat build based on 0.53.0 release by @calda in #255
  • Add rule to avoid using semicolons by @calda in #260
  • Fix markdown formatting of else-on-same-line rule by @calda in #258
  • Add rule to insert a blank line following a switch case with a multi-line body by @calda in #259
  • Update Swift version and SwiftFormat build by @calda in #264
  • Add rule to use doc comments before declarations by @calda in #262

Full Changelog: 1.0.6...1.0.7

1.0.6

15 Dec 14:19
bc6aa7c

Choose a tag to compare

What's Changed

  • Include version-specific package manifests when determining default minimum Swift version by @calda in #235
  • Update to SwiftLint 0.52.1 by @calda in #239
  • Add rule to avoid using @unchecked Sendable by @calda in #237
  • Add rule to prefer weak captures over unowned captures by @calda in #238
  • Fix issue where linter would disallow "@unchecked Sendable" string in comments by @calda in #241
  • Improve discussion and examples for rule to avoid unowned captures by @calda in #240
  • Fix issue where package plugin wouldn't run SwiftLint lint-only rules unless passing in --lint flag by @calda in #242
  • Update to SwiftFormat 0.53 by @calda in #243
  • Improve unit tests by @calda in #244
  • Fix some typos in README by @Jager-yoo in #246
  • Update Package.swift by @elfredpagan in #247
  • Soften wording for rule to avoid using default in switch statements by @calda in #245
  • Update to Swift 5.9 by @calda in #248
  • Update omit-return rule discussion to include examples using if/swift expressions by @calda in #249
  • Specify --shortoptionals always option explicitly since default was updated to except-properties by @calda in #251
  • Use sortImports rule instead of deprecated sortedImports rule by @calda in #252
  • Add rule to add a line break after the assignment operator before a multi-line if or switch expressions by @calda in #253
  • Add rule to prefer using if/switch expressions when initializing a new property with the result of a conditional statement by @calda in #250
  • Add rules for how to wrap attributes on property declarations by @calda in #254

Full Changelog: 1.0.5...1.0.6

1.0.5

08 Aug 19:18
b408d36

Choose a tag to compare

What's Changed

  • Add rule that protocol composition type aliases should be sorted alphabetically by @calda in #227
  • Add rule that else statements should start on the same line as previous closing brace by @calda in #229
  • Add rule to add a linebreak before the else keyword in a multi-line guard statement by @calda in #228
  • Add rules to discourage #file and #filePath by @jqsilver in #231
  • Add package keyword to list of declaration categories by @calda in #232
  • Add rule to omit internal keyword from declarations with internal access control by @calda in #233
  • Add rule to prefer for loops over functional forEach { ... } method by @calda in #234

Full Changelog: 1.0.4...1.0.5

1.0.4

06 May 16:25
6900f5a

Choose a tag to compare

What's Changed

Swift Package Plugin

  • Update linter config to ignore Carthage, Pods, and .build directories by @interactord in #219
  • Update SwiftFormat version to 0.51.8 by @calda in #223
  • Update SwiftFormat --swiftversion to 5.8 by @calda in #225
  • Test multiple Xcode versions in CI by @calda in #224

Swift Style Guide

  • Fix broken SE-0156 link by @hanton in #207
  • Include a missing space after some comment delimiters by @Jager-yoo in #208
  • Clarify Rule: Name unused function parameters as underscores by @Jager-yoo in #210
  • Clarify Rule: Never use the default case when switching over an enum by @teddy5518 in #214
  • Clarify Rule: Use Swift's automatic enum values unless they map to an external source. by @teddy5518 in #215
  • Clarify Rule: Use Swift's automatic enum values unless they map to an external source. by @teddy5518 in #216
  • Clarify Rule: Multi-line arrays should have each bracket on a separate line. by @teddy5518 in #217
  • Clarify Rule: Use caseless enums for organizing public or internal constants and functions into namespaces. by @teddy5518 in #218
  • Fix typos in README.md by @teddy5518 in #220

Full Changelog: 1.0.3...1.0.4

1.0.3

11 Nov 17:22
07bb2e0

Choose a tag to compare

What's Changed

  • Bump SwiftFormat version by @calda in #201
  • Fix typos in Rule 'prefer opaque generic parameter syntax' by @Jager-yoo in #202
  • Update prefer-opaque-generic-parameters XCTest example to pass through file and line by @bachand in #204
  • Update language around when an underscore prefix may be appropriate by @bachand in #203
  • Update Package.swift to explicitly not support Linux by @calda in #206
  • Update rule for long function declarations to specify effects (async, throws) should be written on the line after the closing paren by @calda in #205

Full Changelog: 1.0.2...1.0.3

1.0.2

17 Oct 18:08
f600ed0

Choose a tag to compare

Swift Style Guide

  • Added rule to prefer shorthand if let optional unwrapping syntax (#192)
  • Added rule to prefer simplified generic extension syntax (#194)
  • Added rule to prefer opaque generic parameter syntax (#193)
  • Added rule to prefer trailing closure syntax for closure arguments with no parameter name (#199)

SPM package plugin

  • Improved handling of --swift-format and --exclude arguments (#182)

1.0.1

28 Jul 16:25
1bf9613

Choose a tag to compare

  • The package plugin now uses precompiled binary dependencies for SwiftFormat and SwiftLint instead of compiling them from source. This resolves an issue where SPM would reject .package(url: "https://github.com/airbnb/swift", from: "1.0.0") as invalid.
  • The package plugin now automatically infers the package Swift version from the // swift-tools-version comment in your Package.swift file. You can customize this by calling the plugin with a --swift-version argument.
  • Added XcodeCommandPlugin to support using the package plugin in Xcode 14 project workspaces