Skip to content

Commit 9cfbd59

Browse files
committed
Just use a single message
1 parent a09eadd commit 9cfbd59

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/rubocop/cop/github/rails_controller_render_literal.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ module GitHub
99
class RailsControllerRenderLiteral < Base
1010
include RenderLiteralHelpers
1111

12-
MSG = "render must be used with a string literal or an instance of a Class"
13-
14-
LOCALS_MSG = "render must be used with a hash literal for the locals keyword argument"
12+
MSG = "render must be used with a string literal or an instance of a Class, and use literals for locals keys"
1513

1614
def_node_matcher :ignore_key?, <<-PATTERN
1715
(pair (sym {
@@ -101,7 +99,7 @@ def on_send(node)
10199
if option_pairs
102100
locals = option_pairs.map { |pair| locals_key?(pair) }.compact.first
103101
if locals && (!locals.hash_type? || !hash_with_literal_keys?(locals))
104-
add_offense(node, message: LOCALS_MSG)
102+
add_offense(node)
105103
end
106104
end
107105
end

0 commit comments

Comments
 (0)