class RuboCop::Cop::Style::RedundantException
raise RuntimeError, ‘message’
@example
Currently it checks for code like this:
This cop checks for RuntimeError as the argument of raise/fail.
def on_send(node)
def on_send(node) return unless command?(:raise, node) || command?(:fail, node) _receiver, _selector, *args = *node return unless args.size == 2 first_arg, = *args add_offense(first_arg, :expression) if first_arg == TARGET_NODE end