-
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
opening_brace generates false positives on multi-line conditions with inline closures #2632
Comments
Not a false positive - it's complaining about the brace in the new line, not the closure one. #534 and #1921 already track similar enhancement requests. @robinkunde, do you think one of these would solve your issue? |
@marcelofabri Yes, that's the violation I'm talking about. I'm reporting it as a false positive because it if there is no inline closure in the condition, the same warning is not produced. For example, this doesn't produce a warning: if
"test".isEmpty
{
// code here
} From my reading of the rule's code and nonTriggeringExamples, no warning should be produced in either case. |
It seems you're right, sorry for the noise - didn't know we supported this |
We're also affected by this. It only happens when one of the conditions contains a closure. |
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions! |
I have the same problem |
Same here, I've got multiple conditions (one of them contains a closure). |
I'm also seeing this |
New Issue Checklist
Describe the bug
The following code generates a false positive in the opening_brace rule due to the inline closure:
Complete output when running SwiftLint, including the stack trace and command used
Environment
SwiftLint version: 0.30.1
Installation method used: testing both homebrew and cocoapods
Paste your configuration file: default config (no config file used)
Are you using nested configurations? no
Which Xcode version are you using (check
xcode-select -p
)? 10.1The text was updated successfully, but these errors were encountered: