Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 518 Bytes

Lint-LiteralAsCondition.md

File metadata and controls

35 lines (25 loc) · 518 Bytes

Pattern: Literal as condition

Issue: -

Description

This rule checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until.

Examples

# bad

if 20
  do_something
end
# bad

if some_var && true
  do_something
end
# good

if some_var && some_condition
  do_something
end

Further Reading