We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfe8f2b commit a09eaddCopy full SHA for a09eadd
lib/rubocop/cop/github/rails_controller_render_literal.rb
@@ -11,6 +11,8 @@ class RailsControllerRenderLiteral < Base
11
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"
15
+
16
def_node_matcher :ignore_key?, <<-PATTERN
17
(pair (sym {
18
:body
@@ -99,7 +101,7 @@ def on_send(node)
99
101
if option_pairs
100
102
locals = option_pairs.map { |pair| locals_key?(pair) }.compact.first
103
if locals && (!locals.hash_type? || !hash_with_literal_keys?(locals))
- add_offense(node)
104
+ add_offense(node, message: LOCALS_MSG)
105
end
106
107
0 commit comments