Add Apple's swift-format as a linter#3007
Add Apple's swift-format as a linter#3007
Conversation
08eb0f5 to
9e15e5a
Compare
|
I can't make any sense of the Travis failure. I get completely different failures locally (even on master) making it hard to fix them... It also looks like there is (yet another) failure on master. Any help debugging this would be appreciated. This is my test run locally (mac os) on master: Details
$ ./run-tests --linters-only
Starting Vint...
Starting Custom checks...
|
|
Anything I can do to move this forward? |
w0rp
left a comment
There was a problem hiding this comment.
The only issue here is the list of supported tools, which the linter job is complaining about. There are two different entries for swiftformat and swift-format. It will expect the names with minuses to come before or after other characters in the list somewhere.
aafda3b to
d430729
Compare
d430729 to
2548763
Compare
|
@w0rp fixed now. 😄 |
|
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See |
|
Cheers! 🍻 People might be confused by there being two different tools that sound the same. I guess that's a problem for Swift. |
|
100% agree. SwiftFormat is a community project while swift-format is an Apple project. To make matters even more complicated the Apple project seems to largely be maintained by Google engineers 🤯 Thanks for merging! |
Adds swift-format as a linter.
There are a couple of trade-offs to be aware of:
swift run swift-formatwhen inside a Swift package. Usingswift runmeans it'll build the package and then runswift-format. This can potentially take a while and I've seen it break when the build was interupted. The alternative is to look for swift-format in./build/debug/swift-formatbut it won't exist if the package hasn't been built.ale_linters#swift#swiftformat#Handlebut it doesn't seem to get called whenswift runfails.swift-formatgenerally isn't installed in$PATHwhich means most users will have to setswift_swiftformat_executable. The version ofswift-formatthat is installed by the default (outside of$PATH) is very out of date and is not compatible with this linter implementation.