class Rubocop::Cop::Style::FavorSprintf
literal and if the second argument is an array literal.
only two scenarios are considered - if the first argument is a string
It cannot be implemented in a reliable manner for all cases, so
This cop checks for uses of String#%.
def on_send(node)
def on_send(node) receiver_node, method_name, *arg_nodes = *node if method_name == :% && ([:str, :dstr].include?(receiver_node.type) || arg_nodes[0].type == :array) add_offence(:convention, node.loc.selector, MSG) end super end