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

False positive: empty_count #1113

Closed
ghost opened this issue Jan 3, 2017 · 1 comment
Closed

False positive: empty_count #1113

ghost opened this issue Jan 3, 2017 · 1 comment
Labels
duplicate Issues that already exist in other terms.

Comments

@ghost
Copy link

ghost commented Jan 3, 2017

I get an empty count violation with this code, even though there is no isEmpty in this case: if let count = collectionView?.numberOfItems(inSection: 0), count > 0 { ... }

SwiftLint version 0.15.0

@jpsim jpsim added the duplicate Issues that already exist in other terms. label Jan 3, 2017
@jpsim
Copy link
Collaborator

jpsim commented Jan 3, 2017

We're aware of this false positive category for empty_count, which is why it's marked as an "opt-in" rule.

Many others have reported this (known) issue, so I'll be closing this one as a duplicate.

See #827, #884, #848, #719, and #505 for more discussion on this.

@jpsim jpsim closed this as completed Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues that already exist in other terms.
Projects
None yet
Development

No branches or pull requests

1 participant