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 Lint/AmbiguousOperatorPrecedence cop was inspecting ... #10133

Closed
jethroo opened this issue Sep 28, 2021 · 2 comments
Closed

Comments

@jethroo
Copy link
Contributor

jethroo commented Sep 28, 2021

The Lint/AmbiguousOperatorPrecedence cop is raising in error for me while inspecting a rake task.


Expected behavior

Expect Lint/AmbiguousOperatorPrecedence not to raise an error.

Actual behavior

Describe here what actually happened.
Please use rubocop --debug when pasting rubocop output as it contains additional information.

bundle exec rubocop --debug lib/tasks/populate_company_address_and_phone_with_company_id.rake
For /Users/carstenwirth/Workspace/homeday: configuration from /Users/carstenwirth/Workspace/homeday/.rubocop.yml
Inheriting configuration from /Users/carstenwirth/Workspace/homeday/.rubocop_todo.yml
Default configuration from /Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/config/default.yml
Use parallel by default.
Running parallel inspection
An error occurred while Lint/AmbiguousOperatorPrecedence cop was inspecting /Users/carstenwirth/Workspace/homeday/lib/tasks/populate_company_address_and_phone_with_company_id.rake:41:6.
undefined method `>' for nil:NilClass
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:90:in `greater_precedence?'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:70:in `on_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_and'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:155:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:157:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:154:in `on_def'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_def'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:158:in `on_block'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_block'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/team.rb:155:in `investigate_partial'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/team.rb:83:in `investigate'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:309:in `inspect_file'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:253:in `block in do_inspection_loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:287:in `block in iterate_until_no_changes'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:280:in `loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:280:in `iterate_until_no_changes'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:249:in `do_inspection_loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:130:in `block in file_offenses'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:155:in `file_offense_cache'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:129:in `file_offenses'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:67:in `block in warm_cache'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:515:in `call_with_index'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:485:in `process_incoming_jobs'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:465:in `block in worker'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `fork'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `worker'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:447:in `block in create_workers'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each_with_index'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `create_workers'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:386:in `work_in_processes'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:289:in `map'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/parallel-1.21.0/lib/parallel.rb:238:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:67:in `warm_cache'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:46:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command.rb:11:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/environment.rb:18:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:71:in `run_command'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:78:in `execute_runners'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:47:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/exe/rubocop:12:in `block in <top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/exe/rubocop:12:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/rubocop:23:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/rubocop:23:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:28:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:474:in `exec'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:30:in `dispatch'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:24:in `start'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/exe/bundle:49:in `block in <top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/exe/bundle:37:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/bundle:23:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'
Inspecting 1 file
Scanning /Users/carstenwirth/Workspace/homeday/lib/tasks/populate_company_address_and_phone_with_company_id.rake
An error occurred while Lint/AmbiguousOperatorPrecedence cop was inspecting /Users/carstenwirth/Workspace/homeday/lib/tasks/populate_company_address_and_phone_with_company_id.rake:41:6.
undefined method `>' for nil:NilClass
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:90:in `greater_precedence?'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:70:in `on_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_and'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:155:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:157:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_if'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:154:in `on_def'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_def'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:158:in `on_block'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:71:in `on_block'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-ast-1.12.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/team.rb:155:in `investigate_partial'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cop/team.rb:83:in `investigate'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:309:in `inspect_file'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:253:in `block in do_inspection_loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:287:in `block in iterate_until_no_changes'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:280:in `loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:280:in `iterate_until_no_changes'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:249:in `do_inspection_loop'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:130:in `block in file_offenses'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:155:in `file_offense_cache'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:129:in `file_offenses'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:120:in `process_file'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:101:in `block in each_inspected_file'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:100:in `each'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:100:in `reduce'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:100:in `each_inspected_file'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:86:in `inspect_files'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/runner.rb:47:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/command.rb:11:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli/environment.rb:18:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:71:in `run_command'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:78:in `execute_runners'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/lib/rubocop/cli.rb:47:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/exe/rubocop:12:in `block in <top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rubocop-1.21.0/exe/rubocop:12:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/rubocop:23:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/rubocop:23:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:28:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:474:in `exec'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:30:in `dispatch'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:24:in `start'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/exe/bundle:49:in `block in <top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
/Users/carstenwirth/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.2.21/exe/bundle:37:in `<top (required)>'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/bundle:23:in `load'
/Users/carstenwirth/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'
.

1 file inspected, no offenses detected

1 error occurred:
An error occurred while Lint/AmbiguousOperatorPrecedence cop was inspecting /Users/carstenwirth/Workspace/homeday/lib/tasks/populate_company_address_and_phone_with_company_id.rake:41:6.
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.21.0 (using Parser 3.0.2.0, rubocop-ast 1.12.0, running on ruby 2.6.6 x86_64-darwin19)
Finished in 0.31648000003769994 seconds

Steps to reproduce the problem

Here is the part of the code the cop is failing in (codebase is not public otherwise I would have linked it)

  def update_contact_detail(company, contact_info, mode)
    return unless contact_info

    if contact_info.associated.present?
      return if contact_info.associated == company

      @companies_to_check_manually << company.id
    else
      @updated_companies << company.id and return if mode == 'dryrun'

      if contact_info.update(associated: company)
        @updated_companies << company.id
      else
        @companies_with_update_errors << company.id # Line 41 (rubocop errors here)
      end
    end
  end

RuboCop version

$ bundle exec rubocop -V
1.21.0 (using Parser 3.0.2.0, rubocop-ast 1.12.0, running on ruby 2.6.6 x86_64-darwin19)
@koic
Copy link
Member

koic commented Sep 28, 2021

This issue is a dup with #10096 and resolved by #10101. Thank you.

@koic koic closed this as completed Sep 28, 2021
@koic koic added the duplicate label Sep 28, 2021
@jethroo
Copy link
Contributor Author

jethroo commented Sep 28, 2021

whoops sorry for the dup and thanks for fixing this so fast 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants