-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add four to SwiftVersion #1716
Add four to SwiftVersion #1716
Conversation
Here's an example of your CHANGELOG entry: * Add four to SwiftVersion.
[marcelofabri](https://github.com/marcelofabri)
[#issue_number](https://github.com/realm/SwiftLint/issues/issue_number) note: There are two invisible spaces after the entry's text. Generated by 🚫 Danger |
Codecov Report
@@ Coverage Diff @@
## master #1716 +/- ##
=======================================
Coverage 87.43% 87.43%
=======================================
Files 208 208
Lines 10291 10291
=======================================
Hits 8998 8998
Misses 1293 1293 Continue to review full report at Codecov.
|
Does the same approach not work for Also, kind of a shame that SourceKit itself can't be used to query the Swift version it was built with. There's a "protocol version" request you can make, but that's always been 1.0: https://github.com/apple/swift/blob/master/tools/SourceKit/docs/Protocol.md#protocol-version |
Yes, but that is also true for Swift 4. Since they're the same compiler, just with different modes, I don't even know how SourceKit deals with that (maybe it doesn't?).
Yeah, I've tried that too 😢 |
Anyway, 👍 |
This will allow rules like #1714 to be implemented.
Credits to @ornithocoder for the idea of using
#if swift
.