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

empty_count false positive on hex values #2423

Closed
2 tasks done
alejandro-isaza opened this issue Sep 28, 2018 · 0 comments
Closed
2 tasks done

empty_count false positive on hex values #2423

alejandro-isaza opened this issue Sep 28, 2018 · 0 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@alejandro-isaza
Copy link

New Issue Checklist

Describe the bug

The following code causes a empty_count false positive:

if result.count <= 0xff {
    ...
}
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
abc.swift:115:30: error: Empty Count Violation: Prefer checking `isEmpty` over comparing `count` to zero. (empty_count)

Environment

  • SwiftLint version: 0.27.0

  • Installation method used: Homebrew

  • Which Xcode version: Xcode 10

  • Sample: echo "if result.count <= 0xff {}" | swiftlint lint --no-cache --use-stdin --enable-all-rules

// This triggers a violation:
if result.count <= 0xff {
    ...
}
@realm-probot realm-probot bot added the O:User label Sep 28, 2018
abdulowork pushed a commit to abdulowork/SwiftLint that referenced this issue Oct 2, 2018
abdulowork pushed a commit to abdulowork/SwiftLint that referenced this issue Oct 2, 2018
abdulowork pushed a commit to abdulowork/SwiftLint that referenced this issue Oct 2, 2018
@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Oct 2, 2018
sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
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