-
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 Linux Support #963
Add Linux Support #963
Conversation
to help compile on Linux later
since these aren't optional on Linux, so this will help align cross-platform code.
by addressing differences in FileManager APIs on Linux and Darwin
to align Linux and Darwing code.
by adding an explicit `import Dispatch` and disabling the `atexit_b` call on Linux. This just means that we won't be able to guarantee that the print() buffer will have been flushed at program exit. Hopefully this doesn't cause too many issues.
by addressing differences in APIs between Scanner on Linux and Darwin.
…n Linux since Swift on Linux can't override methods declared in extensions yet.
since `NSRegularExpression.init()` isn't available on Linux yet.
to run all unit tests on Linux
@@ -13,8 +13,8 @@ public struct PrivateUnitTestConfiguration: RuleConfiguration, Equatable { | |||
public let identifier: String | |||
public var name: String? | |||
public var message = "Regex matched." | |||
public var regex = NSRegularExpression() | |||
public var included = NSRegularExpression() | |||
public var regex = NSRegularExpression.forcePattern("placeholder") |
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.
If anyone can come up with a better way to do this to work with both Linux and Darwin, I'm all ears.
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.
maybe make them optional? 😬
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.
Seems obvious, but I couldn't figure it out earlier. Fixed now.
Maybe we should add a note about testing on Linux on https://github.com/realm/SwiftLint/blob/master/CONTRIBUTING.md#rules? |
@jpsim I think we should add an explanation about the |
This is awesome BTW 💯🎉😍 |
Current coverage is 80.96% (diff: 29.16%)@@ master #963 diff @@
==========================================
Files 123 123
Lines 5574 5774 +200
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 4685 4675 -10
- Misses 889 1099 +210
Partials 0 0
|
YOLO |
No description provided.