Skip to content

Files

Latest commit

 

History

History
39 lines (29 loc) · 393 Bytes

Style-RedundantCondition.md

File metadata and controls

39 lines (29 loc) · 393 Bytes

Pattern: Redundant condition

Issue: -

Description

This rule checks for redundant conditional expressions.

Examples

# bad
a = b ? b : c

# good
a = b || c
# bad
if b
  b
else
  c
end

# good
b || c

# good
if b
  b
elsif cond
  c
end

Further Reading