Skip to content
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

Merged
merged 21 commits into from
Dec 12, 2016
Merged

Add Linux Support #963

merged 21 commits into from
Dec 12, 2016

Conversation

jpsim
Copy link
Collaborator

@jpsim jpsim commented Dec 11, 2016

No description provided.

jpsim added 15 commits December 11, 2016 14:04
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
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")
Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make them optional? 😬

Copy link
Collaborator Author

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.

@marcelofabri
Copy link
Collaborator

Maybe we should add a note about testing on Linux on https://github.com/realm/SwiftLint/blob/master/CONTRIBUTING.md#rules?

@marcelofabri
Copy link
Collaborator

@jpsim I think we should add an explanation about the allTests and XCTMain stuff, as people will probably forget to update those as it's not usual on a mac OS environment.

@marcelofabri
Copy link
Collaborator

This is awesome BTW 💯🎉😍

@codecov-io
Copy link

codecov-io commented Dec 11, 2016

Current coverage is 80.96% (diff: 29.16%)

Merging #963 into master will decrease coverage by 3.08%

@@             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          

Powered by Codecov. Last update 05fc8f3...8952626

@jpsim
Copy link
Collaborator Author

jpsim commented Dec 12, 2016

YOLO

@jpsim jpsim merged commit 288a3ec into master Dec 12, 2016
@jpsim jpsim deleted the jp-linux branch December 12, 2016 01:24
@jpsim jpsim mentioned this pull request Dec 12, 2016
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants