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 occurred while Style/RequireOrder cop was inspecting /Users/jonathonfrisby/fb/app/Rakefile:4:0 #11255

Closed
MrJoy opened this issue Dec 8, 2022 · 1 comment · Fixed by #11258
Labels

Comments

@MrJoy
Copy link

MrJoy commented Dec 8, 2022

Expected behavior

I expect RuboCop to process my code without error, as 1.39.0 did.

Actual behavior

Describe here what actually happened.

For /Users/jonathonfrisby/fb/app: configuration from /Users/jonathonfrisby/fb/app/.rubocop.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-eightyfourcodes-0.0.2/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-eightyfourcodes-0.0.2/config/default.yml
Default configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-performance-1.15.1/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-performance-1.15.1/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rake-0.6.0/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rake-0.6.0/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rspec-2.15.0/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rspec-2.15.0/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rubycw-0.1.6/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-rubycw-0.1.6/config/default.yml
configuration from /Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-thread_safety-0.4.4/config/default.yml
configuration from #{path}
Use parallel by default.
Skipping parallel inspection: only a single file needs inspection
Inspecting 1 file
Scanning /Users/jonathonfrisby/fb/app/Rakefile
An error occurred while Style/RequireOrder cop was inspecting /Users/jonathonfrisby/fb/app/Rakefile:4:0.
undefined method `source' for nil:NilClass
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:70:in `block in find_previous_older_sibling'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `each'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `find'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:65:in `find_previous_older_sibling'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/style/require_order.rb:47:in `on_send'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-ast-1.24.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/team.rb:154:in `investigate_partial'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cop/team.rb:82:in `investigate'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:315:in `inspect_file'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:259:in `block in do_inspection_loop'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:293:in `block in iterate_until_no_changes'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:286:in `loop'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:286:in `iterate_until_no_changes'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:255:in `do_inspection_loop'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:138:in `block in file_offenses'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:163:in `file_offense_cache'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:137:in `file_offenses'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:128:in `process_file'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:109:in `block in each_inspected_file'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:108:in `each'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:108:in `reduce'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:108:in `each_inspected_file'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:94:in `inspect_files'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/runner.rb:47:in `run'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/command.rb:11:in `run'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli/environment.rb:18:in `run'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli.rb:72:in `run_command'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli.rb:79:in `execute_runners'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/lib/rubocop/cli.rb:48:in `run'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/exe/rubocop:19:in `block in <top (required)>'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/gems/rubocop-1.40.0/exe/rubocop:19:in `<top (required)>'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/bin/rubocop:25:in `load'
/Users/jonathonfrisby/.rbenv/versions/3.0.4/gemsets/fasterbetter-app/bin/rubocop:25:in `<main>'
.

1 file inspected, no offenses detected

1 error occurred:
An error occurred while Style/RequireOrder cop was inspecting /Users/jonathonfrisby/fb/app/Rakefile:4:0.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop/rubocop/issues

Mention the following information in the issue report:
1.40.0 (using Parser 3.1.3.0, rubocop-ast 1.24.0, running on ruby 3.0.4) [arm64-darwin21]
Finished in 0.25962700007949024 seconds

Steps to reproduce the problem

The problematic line in Rakefile is this:

Bundler.require

Changing that to have an argument (e.g. Bundler.require(:development)) fixes the error.

RuboCop version

% rubocop -V
1.40.0 (using Parser 3.1.3.0, rubocop-ast 1.24.0, running on ruby 3.0.4) [arm64-darwin21]
  - rubocop-performance 1.15.1
  - rubocop-rake 0.6.0
  - rubocop-rspec 2.15.0
  - rubocop-rubycw 0.1.6
  - rubocop-thread_safety 0.4.4
@koic koic added the bug label Dec 9, 2022
ydah added a commit to ydah/rubocop that referenced this issue Dec 9, 2022
…re` with no arguments is put between `require`

Fix: rubocop#11255
koic added a commit that referenced this issue Dec 9, 2022
[Fix #11255] Fix an error for `Style/RequireOrder` when `require` with no arguments is put between `require`
@MrJoy
Copy link
Author

MrJoy commented Dec 9, 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