Pattern: Empty conditional body
Issue: -
This rule checks for the presence of if
, elsif
and unless
branches without a body.
# bad
if condition
end
# bad
unless condition
end
# bad
if condition
do_something
elsif other_condition
end
# good
if condition
do_something
end
# good
unless condition
do_something
end
# good
if condition
do_something
elsif other_condition
do_something_else
end
# good
if condition
do_something
elsif other_condition
# noop
end
# bad
if condition
do_something
elsif other_condition
# noop
end
Name | Default value | Configurable values |
---|---|---|
AllowComments | true |
Boolean |