Skip to content

Commit

Permalink
Highlight only variable name in offense description
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Jan 2, 2019
1 parent d912a64 commit 6dd2d00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/helper_instance_variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def on_ivar(node)
end

def on_ivasgn(node)
add_offense(node)
add_offense(node, location: :name)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rails/helper_instance_variable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def welcome_message
expect_offense(<<-RUBY.strip_indent)
def welcome_message(user)
@user_name = user.name
^^^^^^^^^^^^^^^^^^^^^^ Do not use instance variables in helpers.
^^^^^^^^^^ Do not use instance variables in helpers.
end
RUBY
end
Expand Down

0 comments on commit 6dd2d00

Please sign in to comment.