-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Recommend a linter for Swift? #10
Comments
There is an experimental one |
We probably wont have a real linter for some time. |
👍 for SwiftLint! |
I've been using SwiftLint on a production project and we've really liked it. Also, houndci.com supports Swift. What's important to me is having some sort of consistency, which ruleset is used less so. What can I do to move this forward? |
hound looks interesting. https://houndci.com/configuration#swift |
This would be something that would fit perfectly when we move to swift 3 in a couple of months. |
I haven't written any swift, so I don't have a basis for comparison. @marianaiam have you by any chance written enough Swift in production to have experiential knowledge of linters and style rules? |
It looks like Hound CI wraps SwiftLint. I've found SwiftLint to be great over the last n months and would definitely recommend it. Perhaps the real question is: what's a good config to recommend? |
I think the default rules are fine except for these:
The reason is that some of the tests have really long lines while others use force try to keep the code simple for the tests. Variable names rule is really opinionated as it won't even allow short variables like I am going to turn on the swiftlinter as part of Travis when we update to swift 3.0 |
@masters3d agreed! The only quibble I'd have is the variable names one: I think short var names are an anti-pattern, but maybe not worth having the linter complain? |
I guess instead of disabling
|
* [wip] remove swift 3 directive * [wip] mechanical transition with code migrator * Swift 3 preview 1 changes * travis xcode8 update * travis update OS X 10.12 * updated documentation to swift 3 and Xcode 8 * Removed "Foundation not needed" comment Unlike Objc, swift doesn’t need foundation for most simple operations. I was planning to remove the foundation requirement but now swift 3.0 will provide a Swift version of foundation. https://github.com/apple/swift-corelibs-foundation * ran swiftLink locally with autocorrect - This next step is to turn this on on Travis CI to warn on commit * travis update with swiftlint * update travis * added swiftlint rules yml * update read me with contribution guides closes #66 * update swiftLint rules * force swift3 for XCTest classes by using compiler directive. By wrapping the import to only import when swift 3 is present I am hoping to impress to users that swift 3 is required. Plus this would make it easy to go back and keep requiring a certain a version in the future. * BinarySearchTree using indirect enums closes #152 reference: https://airspeedvelocity.net/2015/07/22/a-persistent-tree-using-indirect -enums-in-swift/ * update swiftlint format requirement update swift lint doc and script in Xcode project `swiftlint autocorrect --format` * operator_whitespace removal * removed leading white space * mid triple new lines clean up * closes #10
We are adopting SwiftLint for swift3. |
This may or may not be appropriate in this language. See exercism/docs#54 for details.
The text was updated successfully, but these errors were encountered: