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

switch_case_on_newline #selector false positive #1020

Closed
mminer opened this issue Dec 21, 2016 · 3 comments
Closed

switch_case_on_newline #selector false positive #1020

mminer opened this issue Dec 21, 2016 · 3 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@mminer
Copy link

mminer commented Dec 21, 2016

The switch_case_on_newline rule incorrectly detects a violation when ones of the cases is a #selector that includes a colon, e.g. in this function:

override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
    let selector = menuItem.action!

    switch selector {
    case #selector(aFunction(_:)):
        return false
    default:
        return true
    }
}
@marcelofabri
Copy link
Collaborator

I had no idea you could switch a selector 😳

@marcelofabri
Copy link
Collaborator

@mminer Can you try #1023 to see if it solves the issue for you?

@mminer
Copy link
Author

mminer commented Dec 21, 2016

@marcelofabri Works well for me; all the false positives in my project are gone. Thanks for the (incredibly fast) fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

2 participants