Swiftformat: `// swiftformat:disable` doesn't affect extensionAccessControl

Created on 15 Oct 2020  Â·  4Comments  Â·  Source: nicklockwood/SwiftFormat

The following example:

// swiftformat:disable all
public protocol Foo {
    func test()
}

internal protocol Bar: Foo {}

extension Bar {
    public func test() {
        // …
    }
}

gets formatted to:

// swiftformat:disable all
public protocol Foo {
    func test()
}

internal protocol Bar: Foo {}

public extension Bar {
    func test() {
        // …
    }
}

which unfortunately breaks compilation (as test() needs to be public to satisfy Foo).

bug fixed in develop

Most helpful comment

@cleverer fixed in 0.47.2

All 4 comments

Thanks for reporting, I'll get it fixed

also --disable extensionacl inside .swiftformat does not affect the swiftformat logic

@Speakus try --disable extensionAccessControl instead.

@cleverer fixed in 0.47.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PompeiaPaetenari picture PompeiaPaetenari  Â·  4Comments

fellipecaetano picture fellipecaetano  Â·  4Comments

dcramps picture dcramps  Â·  3Comments

AniHovhannisyanAni picture AniHovhannisyanAni  Â·  3Comments

DagAgren picture DagAgren  Â·  4Comments