nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 640 forks source link

Closure indentation regression when using --closingparen same-line #951

Closed calda closed 3 years ago

calda commented 3 years ago

When upgrading from 0.48.0 to 0.48.4, I noticed a regression when using --closingparen same-line

Before

public extension Foo {
    func image() -> UIImage? {
        return UIImage.image(with: CGSize(
            width: width,
            height: height)) { _ in
                draw(in: rect)
        }
    }
}

After running swiftformat . --closingparen same-line with 0.48.4

public extension Foo {
    func image() -> UIImage? {
        return UIImage.image(with: CGSize(
            width: width,
            height: height)) { _ in
            draw(in: rect)
        }
    }
}

This change doesn't occur when running swiftformat . --closingparen same-line with 0.48.0

nicklockwood commented 3 years ago

@calda fixed in 0.48.5