diff --git a/Package.swift b/Package.swift index 9e9b136..78cd56d 100644 --- a/Package.swift +++ b/Package.swift @@ -38,8 +38,8 @@ let package = Package( .binaryTarget( name: "SwiftFormat", - url: "https://github.com/calda/SwiftFormat/releases/download/0.51-beta-3/SwiftFormat.artifactbundle.zip", - checksum: "4b0516d911258b55c3960949f4a516a246f35a1dc7647a6440c66e1f1fe1a32e"), + url: "https://github.com/calda/SwiftFormat/releases/download/0.51-beta-6/SwiftFormat.artifactbundle.zip", + checksum: "8583456d892c99f970787b4ed756a7e0c83a0d9645e923bb4dae10d581c59bc3"), .binaryTarget( name: "SwiftLintBinary", diff --git a/README.md b/README.md index c9951df..8c1c71c 100644 --- a/README.md +++ b/README.md @@ -1152,7 +1152,7 @@ _You can enable the following settings in Xcode by running [this script](resourc -* (link) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label and before the return signature.** Put the open curly brace on the next line so the first executable line doesn't look like it's another parameter. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapArguments) [![SwiftFormat: braces](https://img.shields.io/badge/SwiftFormat-braces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#braces) +* (link) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label, and before the return signature or any effects (`async`, `throws`).** Put the open curly brace on the next line so the first executable line doesn't look like it's another parameter. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapArguments) [![SwiftFormat: braces](https://img.shields.io/badge/SwiftFormat-braces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#braces)
@@ -1192,6 +1192,17 @@ _You can enable the following settings in Xcode by running [this script](resourc populateUniverse() // this line blends in with the argument list } + // WRONG + func generateStars( + at location: Point, + count: Int, + color: StarColor, + withAverageDistance averageDistance: Float) async throws // these effects are easy to miss since they're visually associated with the last parameter + -> String + { + populateUniverse() + } + // RIGHT func generateStars( at location: Point, @@ -1209,7 +1220,7 @@ _You can enable the following settings in Xcode by running [this script](resourc count: Int, color: StarColor, withAverageDistance averageDistance: Float) - throws -> String + async throws -> String { populateUniverse() } diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index 4340b27..1ab760e 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -12,6 +12,7 @@ --wrapcollections before-first # wrapArguments --wrapconditions before-first # wrapArguments --wrapreturntype if-multiline #wrapArguments +--wrapeffects if-multiline #wrapArguments --closingparen same-line # wrapArguments --wraptypealiases before-first # wrapArguments --funcattributes prev-line # wrapAttributes