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
Rubocop Layout/EmptyLinesAroundAttributeAccessor inspection fails with an exception when it meets a variable named attr, as in:
classFoodeffooattr.fooendend
Expected behavior
The code should be fine:
Inspecting 1 file
.
1 file inspected, no offenses detected
Actual behavior
Rubocop errors out:
An error occurred while Layout/EmptyLinesAroundAttributeAccessor cop was inspecting /Users/me/dev/spikes/rubocop-test/test.rb:3:4.
undefined method `send_type?' for :foo:Symbol
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:63:in `attribute_accessor?'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:39:in `on_send'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:57:in `block (2 levels) in trigger_responding_cops'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:136:in `with_cop_error_handling'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:56:in `block in trigger_responding_cops'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:55:in `each'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:55:in `trigger_responding_cops'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:32:in `block (2 levels) in <class:Commissioner>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:114:in `block in on_send'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:111:in `each'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:111:in `each_with_index'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:111:in `on_send'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:107:in `on_def'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:99:in `on_class'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/ast/traversal.rb:14:in `walk'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/commissioner.rb:44:in `investigate'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/team.rb:124:in `investigate'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/team.rb:112:in `offenses'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cop/team.rb:44:in `inspect_file'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:301:in `inspect_file'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:249:in `block in do_inspection_loop'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:281:in `block in iterate_until_no_changes'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:274:in `loop'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:274:in `iterate_until_no_changes'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:245:in `do_inspection_loop'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:124:in `block in file_offenses'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:148:in `file_offense_cache'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:122:in `file_offenses'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:113:in `process_file'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:92:in `block in each_inspected_file'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:91:in `each'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:91:in `reduce'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:91:in `each_inspected_file'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:78:in `inspect_files'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/runner.rb:39:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli/command.rb:10:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli/environment.rb:17:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli.rb:65:in `run_command'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli.rb:72:in `execute_runners'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/lib/rubocop/cli.rb:41:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/exe/rubocop:13:in `block in <top (required)>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.83.0/exe/rubocop:12:in `<top (required)>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bin/rubocop:23:in `load'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bin/rubocop:23:in `<top (required)>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `load'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli/exec.rb:28:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli.rb:476:in `exec'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli.rb:30:in `dispatch'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/cli.rb:24:in `start'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:46:in `block in <top (required)>'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/Users/me/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:34:in `<top (required)>'
/Users/me/.rbenv/versions/2.7.1/bin/bundle:23:in `load'
/Users/me/.rbenv/versions/2.7.1/bin/bundle:23:in `<main>'
.
1 file inspected, no offenses detected
1 error occurred:
An error occurred while Layout/EmptyLinesAroundAttributeAccessor cop was inspecting /Users/me/dev/spikes/rubocop-test/test.rb:3:4.
NOTE for master branch: When testing on master branch, the error is undefined method 'alias_type?' for :foo:Symbol instead of undefined method 'send_type?' for :foo:Symbol
Rubocop Layout/EmptyLinesAroundAttributeAccessor inspection fails with an exception when it meets a variable named
attr
, as in:Expected behavior
The code should be fine:
Actual behavior
Rubocop errors out:
NOTE for master branch: When testing on
master
branch, the error isundefined method 'alias_type?' for :foo:Symbol
instead ofundefined method 'send_type?' for :foo:Symbol
Steps to reproduce the problem
Create
test.rb
with the following content:Run Rubocop inspection on it:
RuboCop version
Tested on Rubocop 0.83.0, and master@8376d3dc5a6e
When testing on
master
branch, the error isundefined method 'alias_type?' for :foo:Symbol
instead ofundefined method 'send_type?' for :foo:Symbol
The text was updated successfully, but these errors were encountered: