Skip to content

Commit 6dd2d00

Browse files
committed
Highlight only variable name in offense description
1 parent d912a64 commit 6dd2d00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rubocop/cop/rails/helper_instance_variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def on_ivar(node)
3131
end
3232

3333
def on_ivasgn(node)
34-
add_offense(node)
34+
add_offense(node, location: :name)
3535
end
3636
end
3737
end

spec/rubocop/cop/rails/helper_instance_variable_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def welcome_message
1616
expect_offense(<<-RUBY.strip_indent)
1717
def welcome_message(user)
1818
@user_name = user.name
19-
^^^^^^^^^^^^^^^^^^^^^^ Do not use instance variables in helpers.
19+
^^^^^^^^^^ Do not use instance variables in helpers.
2020
end
2121
RUBY
2222
end

0 commit comments

Comments
 (0)