Skip to content

Fix Style/BitwisePredicate when using a method#13411

Merged
koic merged 2 commits intorubocop:masterfrom
d4be4st:fix_bitwise_predicate_when_using_a_method
Nov 3, 2024
Merged

Fix Style/BitwisePredicate when using a method#13411
koic merged 2 commits intorubocop:masterfrom
d4be4st:fix_bitwise_predicate_when_using_a_method

Conversation

@d4be4st
Copy link
Contributor

@d4be4st d4be4st commented Nov 2, 2024

Fix Style/BitwisePredicate when using a method.

When having a regular method named positive? or zero? the cop would raise an error.

def positive?
  some_ruby_code
end

Would throw a

NoMethodError: undefined method `begin_type?' for nil:NilClass

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@d4be4st d4be4st force-pushed the fix_bitwise_predicate_when_using_a_method branch from dee399a to 822412e Compare November 2, 2024 21:03
@koic koic merged commit 76a7e00 into rubocop:master Nov 3, 2024
@koic
Copy link
Member

koic commented Nov 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants