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 positives when using identical_operands with nested array #2467

Closed
2 tasks done
konomae opened this issue Nov 19, 2018 · 2 comments
Closed
2 tasks done

False positives when using identical_operands with nested array #2467

konomae opened this issue Nov 19, 2018 · 2 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@konomae
Copy link

konomae commented Nov 19, 2018

New Issue Checklist

Describe the bug

False positives when using identical_operands with nested array.
SwiftLint 0.28.1

.swiftlint.yml

whitelist_rules:
  - identical_operands

main.swift

Array<Array<Int>>()
Complete output when running SwiftLint, including the stack trace and command used
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths 
Linting 'main.swift' (1/1)
/Users/user/swiftlint-test/main.swift:1:1: warning: Identical Operands Violation: Comparing two identical operands is likely a mistake. (identical_operands)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.28.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? cocoapods
  • Paste your configuration file:
whitelist_rules:
  - identical_operands
@realm-probot realm-probot bot added the O:User label Nov 19, 2018
@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Nov 19, 2018
@xavierLowmiller
Copy link
Contributor

I have another false positive that might be related:

let isLowercase = string == string.lowercased()

Will open a PR momentarily.

@jpsim
Copy link
Collaborator

jpsim commented Jan 17, 2019

Fixed in 0.29.4.

@jpsim jpsim closed this as completed Jan 17, 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

4 participants