-
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 ImplicitGetterRule #862
Conversation
Current coverage is 85.84% (diff: 97.18%)
|
False positive pattern with local scoped type: class Foo {
var foo: Int {
struct Bar {
var bar: Int {
get { return 1 } // violation produced on this line
set { _ = newValue }
}
}
return Bar().bar
}
} |
Nice catch! Do you have any tips on how to deal with this? |
If I need to write this rule, I guess I would do:
The key of avoiding false positive is 2. |
} | ||
|
||
private func variableDeclarationsFor(byteOffset: Int, structure: Structure) -> | ||
[[String : SourceKitRepresentable]] { |
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.
I'm not a fan of breaking line here, but I couldn't think of other ways to respect the 100 length limit 😬
Sorry for taking to take a look at this, but I've implemented your suggestion on 772e702, @norio-nomura. Thanks again 🙌 |
Awesome work! 🎉 |
My project can run in my old Macbook Pro but show the error in my new Mac mini. I check my Xcode(11.4.1) and swift version(4.2) are all the same. how to solve this issue? I use cocoa pod to install swiftlint and the version is 0.27. (pod 'SwiftLint', '0.27'). I check the document many times but still can't find the answer. |
Partially fixes #57
It seems that SourceKit doesn't provide information on
subscript
, which is weird because there is aFunctionSubscript
case onSyntaxKind
.