-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
$ ./run-tests --linters-only
Starting Vint...
Starting Custom checks...
|
Anything I can do to move this forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-format
when inside a Swift package. Usingswift run
means 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-format
but it won't exist if the package hasn't been built.ale_linters#swift#swiftformat#Handle
but it doesn't seem to get called whenswift run
fails.swift-format
generally isn't installed in$PATH
which means most users will have to setswift_swiftformat_executable
. The version ofswift-format
that is installed by the default (outside of$PATH
) is very out of date and is not compatible with this linter implementation.