Rubocop-rspec: RSpec/FilePath error occurs in 1.43.0

Created on 17 Aug 2020  路  3Comments  路  Source: rubocop-hq/rubocop-rspec

After changing rubocop-rspec version to 1.43.0, I got the following error.
It may be some kind of bug, so we would appreciate it if you could fix it.

bundle exec rubocop -d app//channels/application_cable/channel.rb
An error occurred while RSpec/FilePath cop was inspecting /app/app/channels/application_cable/channel.rb.
undefined method `begin_type?' for nil:NilClass
/usr/local/bundle/ruby/2.6.0/gems/rubocop-rspec-1.43.0/lib/rubocop/rspec/top_level_group.rb:41:in `top_level_nodes'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-rspec-1.43.0/lib/rubocop/rspec/top_level_group.rb:44:in `top_level_nodes'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-rspec-1.43.0/lib/rubocop/rspec/top_level_group.rb:44:in `top_level_nodes'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-rspec-1.43.0/lib/rubocop/rspec/top_level_group.rb:26:in `top_level_groups'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-rspec-1.43.0/lib/rubocop/rspec/top_level_group.rb:18:in `on_new_investigation'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:103:in `block (2 levels) in invoke'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:112:in `with_cop_error_handling'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:102:in `block in invoke'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:101:in `each'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:101:in `invoke'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:72:in `investigate'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/team.rb:151:in `investigate_partial'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cop/team.rb:83:in `investigate'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:295:in `inspect_file'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:245:in `block in do_inspection_loop'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:277:in `block in iterate_until_no_changes'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:270:in `loop'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:270:in `iterate_until_no_changes'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:241:in `do_inspection_loop'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:121:in `block in file_offenses'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:146:in `file_offense_cache'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:120:in `file_offenses'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:111:in `process_file'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:90:in `block in each_inspected_file'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:89:in `each'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:89:in `reduce'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:89:in `each_inspected_file'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:78:in `inspect_files'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/runner.rb:39:in `run'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli/command/execute_runner.rb:13:in `run'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli/command.rb:10:in `run'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli/environment.rb:17:in `run'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli.rb:65:in `run_command'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli.rb:72:in `execute_runners'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/lib/rubocop/cli.rb:41:in `run'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/exe/rubocop:13:in `block in <top (required)>'
/usr/local/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/usr/local/bundle/ruby/2.6.0/gems/rubocop-0.89.1/exe/rubocop:12:in `<top (required)>'
/usr/local/bundle/ruby/2.6.0/bin/rubocop:23:in `load'
/usr/local/bundle/ruby/2.6.0/bin/rubocop:23:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
.

1 file inspected, no offenses detected

1 error occurred:
An error occurred while RSpec/FilePath cop was inspecting /app/app/channels/application_cable/channel.rb.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop-hq/rubocop/issues

Mention the following information in the issue report:
0.89.1 (using Parser 2.7.1.4, rubocop-ast 0.3.0, running on ruby 2.6.5 x86_64-linux-musl)

Below is the content of app/channels/application_cable/channel.rb.

module ApplicationCable
  class Channel < ActionCable::Channel::Base
  end
end
bug

Most helpful comment

Confirmed. I just ran into the same bug and will try fixing it right away.

All 3 comments

Confirmed. I just ran into the same bug and will try fixing it right away.

Thank you for the bug report @steiley. v1.43.1 has just been released containing a fix.

@bquorning

Thank you for the bug report @steiley. v1.43.1 has just been released containing a fix.

I confirmed that the error disappeared.
Thanks for the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luizkowalski picture luizkowalski  路  5Comments

bbatsov picture bbatsov  路  7Comments

roman-dubrovsky picture roman-dubrovsky  路  4Comments

bquorning picture bquorning  路  4Comments

aried3r picture aried3r  路  7Comments