You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing an integer bit field the yoda_condition rule triggers a false positive.
if flags &1==1{
// ...
}
##### Complete output when running SwiftLint, including the stack trace and command used
```bash
$ swiftlint lint
file.swift:2:1: warning: Yoda condition rule Violation: The variable should be placed on the left, the constant on the right of a comparison operator.(yoda_condition)
Environment
SwiftLint version (run swiftlint version to be sure)? 0.47.1
Installation method used (Homebrew, CocoaPods, building from source, etc)? brew
Which Xcode version are you using (check xcodebuild -version)? N/A
Do you have a sample that shows the issue?
>echo"if b & 1 == 1"| swiftlint lint --no-cache --use-stdin --enable-all-rules
<nopath>:1:1: warning: Yoda condition rule Violation: The variable should be placed on the left, the constant on the right of a comparison operator. (yoda_condition)
Done linting! Found 1 violation, 0 serious in 1 file.
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Describe the bug
When testing an integer bit field the yoda_condition rule triggers a false positive.
Environment
swiftlint version
to be sure)? 0.47.1xcodebuild -version
)? N/AThe text was updated successfully, but these errors were encountered: