Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Bitwise Predicate Methods" rule
Follow up rubocop/rubocop#13050. This PR adds "Bitwise Predicate Methods" rule. Prefer the use of bitwise predicate methods to bitwise operations involving comparisons. ```ruby # bad - checks any set bits (variable & flags).positive? # good variable.anybits?(flags) # bad - checks all set bits (variable & flags) == flags # good variable.allbits?(flags) # bad - checks no set bits (variable & flags).zero? (variable & flags) == 0 # good variable.nobits?(flags) ```
- Loading branch information