Skip to content
New issue

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

An error occured while Style/RequireOrder cop was inspecting config/boot.rb #11267

Closed
Marthyn opened this issue Dec 12, 2022 · 2 comments · Fixed by #11268
Closed

An error occured while Style/RequireOrder cop was inspecting config/boot.rb #11267

Marthyn opened this issue Dec 12, 2022 · 2 comments · Fixed by #11268
Labels

Comments

@Marthyn
Copy link

Marthyn commented Dec 12, 2022

After updating from rubocop 1.39.0 to 1.40.0 we encountered this error. Rubocop is erroring on a line in our boot.rb file with this new version.


Expected behavior

No error

Actual behavior

An error occurred

Output rubocop --debug

An error occurred while Style/RequireOrder cop was inspecting /Users/marthyn/code/floryn/config/boot.rb:7:0.
undefined method `send_type?' for nil:NilClass

            break unless sibling.send_type?
                                ^^^^^^^^^^^
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:66:in `block in find_previous_older_sibling'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `each'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `find'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `find_previous_older_sibling'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:47:in `on_send'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:157:in `on_if'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:71:in `on_if'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/team.rb:154:in `investigate_partial'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cop/team.rb:82:in `investigate'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:315:in `inspect_file'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:259:in `block in do_inspection_loop'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:293:in `block in iterate_until_no_changes'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:286:in `loop'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:286:in `iterate_until_no_changes'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:255:in `do_inspection_loop'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:138:in `block in file_offenses'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:163:in `file_offense_cache'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:137:in `file_offenses'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:73:in `block in warm_cache'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:587:in `call_with_index'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:557:in `process_incoming_jobs'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:537:in `block in worker'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:528:in `fork'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:528:in `worker'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:519:in `block in create_workers'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:518:in `each'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:518:in `each_with_index'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:518:in `create_workers'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:457:in `work_in_processes'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:294:in `map'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/parallel-1.22.1/lib/parallel.rb:238:in `each'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:73:in `warm_cache'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/runner.rb:46:in `run'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/command.rb:11:in `run'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli/environment.rb:18:in `run'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli.rb:72:in `run_command'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli.rb:79:in `execute_runners'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/lib/rubocop/cli.rb:48:in `run'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/exe/rubocop:19:in `block in <top (required)>'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/benchmark.rb:311:in `realtime'
/Users/marthyn/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.40.0/exe/rubocop:19:in `<top (required)>'
/Users/marthyn/.asdf/installs/ruby/3.1.2/bin/rubocop:25:in `load'
/Users/marthyn/.asdf/installs/ruby/3.1.2/bin/rubocop:25:in `<main>'

Including the source of boot.rb for easier debugging

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.

# We don't want to use Bootsnap in production, for now. See https://github.com/Shopify/bootsnap/issues/123
env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'production'
require 'bootsnap/setup' unless env == 'production'

Steps to reproduce the problem

  • Use rubocop 1.40.0
  • run rubocop
  • The error appears.

RuboCop version

$ [bundle exec] rubocop -V
1.40.0 (using Parser 3.1.3.0, rubocop-ast 1.24.0, running on ruby 3.1.2) [arm64-darwin21]
  - rubocop-performance 1.15.1
  - rubocop-rails 2.17.3
  - rubocop-rspec 2.15.0
@Marthyn
Copy link
Author

Marthyn commented Dec 12, 2022

I saw this issue as well. #11255. Since that is fixed I'll re-run with master and see if it's the same issue,

@Marthyn
Copy link
Author

Marthyn commented Dec 12, 2022

I saw this issue as well. #11255. Since that is fixed I'll re-run with master and see if it's the same issue,

Using the master branch did not fix the error. Error remains the same in this.

An error occurred while Style/RequireOrder cop was inspecting /Users/marthyn/code/floryn/config/boot.rb:7:0.
undefined method `send_type?' for nil:NilClass

            break unless sibling.send_type?
                                ^^^^^^^^^^^

@koic koic added the bug label Dec 12, 2022
ydah added a commit to ydah/rubocop that referenced this issue Dec 20, 2022
bbatsov pushed a commit that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants