We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Performance/AncestorsInclude with auto correct raises error
Add <file> with text ancestors.include?(SomeClass) Check it with rubocop <file> --auto-correct --debug
<file>
ancestors.include?(SomeClass)
rubocop <file> --auto-correct --debug
Output includes error:
An error occurred while Performance/AncestorsInclude cop was inspecting <file>:1:0. undefined method `source' for nil:NilClass ~/rubocop-performance-1.7.0/lib/rubocop/cop/performance/ancestors_include.rb:38:in `block (2 levels) in autocorrect' ~/rubocop-0.87.1/lib/rubocop/cop/cop.rb:134:in `block in emulate_v0_callsequence' ~/rubocop-0.87.1/lib/rubocop/cop/cop.rb:154:in `suppress_clobbering' ~/rubocop-0.87.1/lib/rubocop/cop/cop.rb:133:in `emulate_v0_callsequence' ~/rubocop-0.87.1/lib/rubocop/cop/cop.rb:34:in `block in add_offense' ~/rubocop-0.87.1/lib/rubocop/cop/base.rb:302:in `correct' ~/rubocop-0.87.1/lib/rubocop/cop/base.rb:115:in `add_offense' ~/rubocop-0.87.1/lib/rubocop/cop/cop.rb:33:in `add_offense'
rubocop -V 0.87.1 (using Parser 2.7.1.4, rubocop-ast 0.1.0, running on ruby 2.6.6 x86_64-linux)
The text was updated successfully, but these errors were encountered:
[Fix rubocop#147] Fix an error for Performance/AncestorsInclude
Performance/AncestorsInclude
1600d30
Fixes rubocop#147. This PR fixes an error for `Performance/AncestorsInclude` when using `ancestors.include? without receiver.
8537694
Fixes rubocop#147. This PR fixes an error for `Performance/AncestorsInclude` when using `ancestors.include?` without receiver.
839e35b
Merge pull request #148 from koic/fix_error_for_performance_ancestors…
337d869
…_include [Fix #147] Fix an error for `Performance/AncestorsInclude`
Successfully merging a pull request may close this issue.
Performance/AncestorsInclude with auto correct raises error
Steps to reproduce the problem
Add
<file>
with textancestors.include?(SomeClass)
Check it with
rubocop <file> --auto-correct --debug
Output includes error:
RuboCop version
The text was updated successfully, but these errors were encountered: