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
I've just updated Rubocop to release 0.49.0 and hitting error while hitting for ... in loops. I pinpointed the issue to the use of Style/ConditionalAssignment cop while enforcing assign_inside_condition
Stack trace below:
An error occurred while Style/ConditionalAssignment cop was inspecting An error occurred while Style/ConditionalAssignment cop was inspecting /Users/tom/Hanover/test.rb:1:4.
undefined method `begin_type?' for :i:Symbol
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/style/conditional_assignment.rb:304:in `assignment_node'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/style/conditional_assignment.rb:274:in `check_assignment_to_condition'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/style/conditional_assignment.rb:233:in `block (2 levels) in <class:ConditionalAssignment>'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:44:in `block (2 levels) in on_lvasgn'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:43:in `block in on_lvasgn'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:42:in `each'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:42:in `on_lvasgn'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/ast/traversal.rb:161:in `block in on_case'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/ast/traversal.rb:160:in `each'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/ast/traversal.rb:160:in `on_case'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:48:in `on_for'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/ast/traversal.rb:12:in `walk'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/commissioner.rb:60:in `investigate'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/team.rb:112:in `investigate'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/team.rb:100:in `offenses'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cop/team.rb:42:in `inspect_file'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:258:in `inspect_file'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:205:in `block in do_inspection_loop'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:237:in `block in iterate_until_no_changes'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:230:in `loop'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:230:in `iterate_until_no_changes'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:201:in `do_inspection_loop'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:111:in `block in file_offenses'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:121:in `file_offense_cache'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:109:in `file_offenses'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:100:in `process_file'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:78:in `block in each_inspected_file'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:75:in `each'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:75:in `reduce'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:75:in `each_inspected_file'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:67:in `inspect_files'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/runner.rb:39:in `run'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cli.rb:82:in `execute_runner'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/lib/rubocop/cli.rb:28:in `run'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/bin/rubocop:13:in `block in <top (required)>'
/Users/tom/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/gems/rubocop-0.49.0/bin/rubocop:12:in `<top (required)>'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/bin/rubocop:23:in `load'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/bin/rubocop:23:in `<main>'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/bin/ruby_executable_hooks:15:in `eval'
/Users/tom/.rvm/gems/ruby-2.4.1@hanover/bin/ruby_executable_hooks:15:in `<main>'
I've just updated Rubocop to release 0.49.0 and hitting error while hitting for ... in loops. I pinpointed the issue to the use of Style/ConditionalAssignment cop while enforcing assign_inside_condition
Stack trace below:
Expected behavior
No errors, apart from style errors appear
Actual behavior
Rubocop error occurs
Steps to reproduce the problem
Run rubocop on simple file like:
With cop
RuboCop version
The text was updated successfully, but these errors were encountered: