-
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
False positive implicit_getter
violation when mentioning word "set" in a comment in custom getter of a read-write var
#3149
Comments
Pretty sure this fixes it? |
Oh, thanks. I somehow missed that PR during my search for existing reports. |
It doesn’t include that fix IMO |
0.39.1 is almost two months old, |
From what I see, 0.39.1 already includes that code (4e84992): |
It's also triggering a false positive if we have both a extension Reactive where Base: UITapGestureRecognizer {
var tapped: CocoaAction<Base>? {
get {
return associatedAction.withValue { $0.flatMap { $0.action } }
}
nonmutating set {
setAction(newValue)
}
}
} |
I found another false-positive. When the extension Float {
var clamped: Float {
set {
self = min(1, max(0, newValue))
}
get {
min(1, max(0, self))
}
}
} Command:
Output:
|
@marcelofabri thanks a lot! |
thanks for everyone reporting different minimal examples! this has been very helpful to fix the issue quickly |
Which release is this going to and when? |
The fix will go in the next release, either 0.39.2 or 0.40.0, depending on how we choose to version it. That’ll be in the next few days probably. Depends on if we think we can get more Swift 5.2 fixes in time. |
@freak4pc can you see if the latest commit from master fixes that for you? |
Looking forward to the fixing release. My code below still triggers this false positive on 0.39.1:
Update: it resolves if I move the getter above the setter:
|
no fix ? |
@jpsim my issues are fixed on the last |
u need find file : .swiftlint.yml , then just do it
|
New Issue Checklist
Describe the bug
Mentioning word "set" (without parentheses) in a comment in a
get
of a read-write var with both get and set defined triggers SwiftLint to think that this is a read-only property.Complete output when running SwiftLint, including the stack trace and command used
Environment
Are you using nested configurations?No
Which Xcode version are you using (check
xcodebuild -version
)?Xcode 11.4
Build version 11E146
Do you have a sample that shows the issue?
Yes:
Test.swift
If I don't mention word "set" in the comment then it seem to work fine.
I don't recall seeing this issues prior to updating to Xcode 11.4.
Hope it helps.
The text was updated successfully, but these errors were encountered: