Skip to content

Files

Latest commit

 

History

History
29 lines (20 loc) · 571 Bytes

Lint-MultipleComparison.md

File metadata and controls

29 lines (20 loc) · 571 Bytes

Pattern: Invalid multiple comparison

Issue: -

Description

In math and Python, you can use x < y < z style comparison to compare multiple value. However, you can't use the comparison in Ruby. However, the comparison is not syntax error. This rule checks the bad usage of comparison operators.

Examples

# bad

x < y < z
10 <= x <= 20
# good

x < y && y < z
10 <= x && x <= 20

Further Reading