Swiftformat: Wrong order of specifiers

Created on 14 Feb 2019  路  7Comments  路  Source: nicklockwood/SwiftFormat

specifiers rule forces a wrong order of specifiers. According to the docs the rule should work like this:

- public override final func foo()
+ final override public func foo()

But observed result is this:
final public override func foo()

SwiftFormat version 0.39.0

bug

Most helpful comment

Fixed in 0.44.8

All 7 comments

@schwarja thanks for reporting. I think it's the docs that are wrong in this case, so I'll update them.

@schwarja I've corrected the docs for 0.39.2. Thanks!

@nicklockwood The problem is still there, it is not a doc problem.
override should be in front. See in swift doc override internal func someMethod() {}
https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html

SwiftFormat version 0.40.10

@nicklockwood I agree with @mbentin, it's also the default in swiftlint.

Could you change it or at least make the rule configurable?

We've also run into this issue with SwiftLint vs SwiftFormat. I agree with weakfl that this should probably be configurable. @a2 do we have any bandwidth to open a PR with this? Would be nice to have both be able to run independently without messing up the other.

Sorry, I missed the follow-up comments since they were in a closed issue. I'm happy to change the order to match SwiftLint.

Fixed in 0.44.8

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdiep picture mdiep  路  3Comments

DagAgren picture DagAgren  路  4Comments

meherkasam picture meherkasam  路  3Comments

Cyberbeni picture Cyberbeni  路  4Comments

DavinAhn picture DavinAhn  路  4Comments