class RuboCop::Cop::Lint::EmptyConditionalBody


end
# noop
elsif other_condition
do_something
if condition
# bad
@example AllowComments: false
end
# noop
elsif other_condition
do_something
if condition
# good
@example AllowComments: true (default)
end
do_something_else
elsif other_condition
do_something
if condition
# good
end
do_something
unless condition
# good
end
do_something
if condition
# good
end
elsif other_condition
do_something
if condition
# bad
end
unless condition
# bad
end
if condition
# bad
@example
This cop checks for the presence of ‘if`, `elsif` and `unless` branches without a body.

def on_if(node)

def on_if(node)
  return if node.body
  return if cop_config['AllowComments'] && comment_lines?(node)
  add_offense(node, message: format(MSG, keyword: node.keyword))
end