-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #7595. This PR makes `Style/NumericPredicate` aware of ignored methods when specifying ignored methods. The following is a reproduction procedure. ```console % cat .rubocop.yml # .rubocop.yml Style/NumericPredicate: EnforcedStyle: comparison IgnoredMethods: 'zero?' % cat example.rb if foo.zero? puts 'hello' end % bundle exec rubocop --only Style/NumericPredicate --cache false example.rb Inspecting 1 file C Offenses: example.rb:1:4: C: Style/NumericPredicate: Use foo == 0 instead of foo.zero?. if foo.zero? ^^^^^^^^^ 1 file inspected, 1 offense detected ``` This PR resolves the issue caused by the callback node itself not being checked.
- Loading branch information
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters