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
RuboCop 0.91.0 crashes on code that parsed and linted correctly with 0.90.0.
Expected behavior
RuboCop successfully lints the file
Actual behavior
Describe here what actually happened.
RuboCop crashes.
$ bundle exec rubocop .Inspecting 1 fileAn error occurred while Lint/IdentityComparison cop was inspecting /Users/lopopolo/dev/artichoke/artichoke/temp/foo.rb:5:4.To see the complete backtrace run rubocop -d..1 file inspected, no offenses detected1 error occurred:An error occurred while Lint/IdentityComparison cop was inspecting /Users/lopopolo/dev/artichoke/artichoke/temp/foo.rb:5:4.Errors are usually caused by RuboCop bugs.Please, report your problems to RuboCop's issue tracker.https://github.com/rubocop-hq/rubocop/issuesMention the following information in the issue report:0.91.0 (using Parser 2.7.1.4, rubocop-ast 0.4.0, running on ruby 2.6.3 x86_64-darwin19)
$ bundle exec rubocop -d .For /Users/lopopolo/dev/artichoke/artichoke/temp: configuration from /Users/lopopolo/dev/artichoke/artichoke/.rubocop.ymlconfiguration from /usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-rake-0.5.1/config/default.ymlconfiguration from /usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-rake-0.5.1/config/default.ymlDefault configuration from /usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/config/default.ymlInspecting 1 fileScanning /Users/lopopolo/dev/artichoke/artichoke/temp/foo.rbAn error occurred while Lint/IdentityComparison cop was inspecting /Users/lopopolo/dev/artichoke/artichoke/temp/foo.rb:5:4.undefined method `source' for nil:NilClass/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/lint/identity_comparison.rb:29:in `block in on_send'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/base.rb:333:in `correct'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/base.rb:126:in `add_offense'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/lint/identity_comparison.rb:28:in `on_send'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:122:in `block (2 levels) in trigger_restricted_cops'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:152:in `with_cop_error_handling'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:121:in `block in trigger_restricted_cops'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:120:in `each'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:120:in `trigger_restricted_cops'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:71:in `on_send'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-ast-0.4.0/lib/rubocop/ast/traversal.rb:109:in `on_def'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:72:in `on_def'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-ast-0.4.0/lib/rubocop/ast/traversal.rb:101:in `on_class'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:72:in `on_class'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-ast-0.4.0/lib/rubocop/ast/traversal.rb:14:in `walk'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/commissioner.rb:85:in `investigate'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/team.rb:152:in `investigate_partial'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cop/team.rb:83:in `investigate'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:311:in `inspect_file'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:255:in `block in do_inspection_loop'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:289:in `block in iterate_until_no_changes'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:282:in `loop'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:282:in `iterate_until_no_changes'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:251:in `do_inspection_loop'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:128:in `block in file_offenses'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:153:in `file_offense_cache'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:127:in `file_offenses'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:118:in `process_file'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:97:in `block in each_inspected_file'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:96:in `each'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:96:in `reduce'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:96:in `each_inspected_file'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:82:in `inspect_files'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/runner.rb:43:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli/command.rb:11:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli/environment.rb:18:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli.rb:65:in `run_command'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli.rb:72:in `execute_runners'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/lib/rubocop/cli.rb:41:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/exe/rubocop:13:in `block in <top (required)>'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rubocop-0.91.0/exe/rubocop:12:in `<top (required)>'/usr/local/var/rbenv/versions/2.6.3/bin/rubocop:23:in `load'/usr/local/var/rbenv/versions/2.6.3/bin/rubocop:23:in `<top (required)>'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'/usr/local/var/rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'/usr/local/var/rbenv/versions/2.6.3/bin/bundle:23:in `load'/usr/local/var/rbenv/versions/2.6.3/bin/bundle:23:in `<main>'.1 file inspected, no offenses detected1 error occurred:An error occurred while Lint/IdentityComparison cop was inspecting /Users/lopopolo/dev/artichoke/artichoke/temp/foo.rb:5:4.Errors are usually caused by RuboCop bugs.Please, report your problems to RuboCop's issue tracker.https://github.com/rubocop-hq/rubocop/issuesMention the following information in the issue report:0.91.0 (using Parser 2.7.1.4, rubocop-ast 0.4.0, running on ruby 2.6.3 x86_64-darwin19)Finished in 0.12186599988490343 seconds
My usecase for Object#object_id equality comparisons is to prevent infinite recursion when implementing something like Hash#inspect. I believe it is less likely for Object#object_id to get overridden than equal?.
RuboCop 0.91.0 crashes on code that parsed and linted correctly with 0.90.0.
Expected behavior
RuboCop successfully lints the file
Actual behavior
Describe here what actually happened.
RuboCop crashes.
Steps to reproduce the problem
With
foo.rb
contents:RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: