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 with toggle_bool #2471

Closed
2 tasks done
rounak opened this issue Nov 19, 2018 · 1 comment
Closed
2 tasks done

False positive with toggle_bool #2471

rounak opened this issue Nov 19, 2018 · 1 comment
Labels
bug Unexpected and reproducible misbehavior.

Comments

@rounak
Copy link
Contributor

rounak commented Nov 19, 2018

New Issue Checklist

Describe the bug

object.property = !property This triggers a toggle_bool warning even though property is a local variable, and calling .toggle() on object.property might produce incorrect results.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.28.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? cocoapods
  • Which Xcode version are you using (check xcode-select -p)? 10.1
  • Do you have a sample that shows the issue? Run echo "object.property = !property" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue.
// This triggers a violation:
object.property = !property
@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Nov 19, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 23, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 23, 2018
jpsim pushed a commit that referenced this issue Nov 24, 2018
* #2471 - Fix false positive toggle_bool by using negative lookbehind on dot and word character

* #2471 - Update changelog
@jpsim
Copy link
Collaborator

jpsim commented Nov 24, 2018

Fixed in #2479

@jpsim jpsim closed this as completed Nov 24, 2018
sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
* realm#2471 - Fix false positive toggle_bool by using negative lookbehind on dot and word character

* realm#2471 - Update changelog
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

3 participants