struct Ameba::Rules::ComparisonToBoolean
- Ameba::Rules::ComparisonToBoolean
- Ameba::Rule
- Struct
- Value
- Object
Overview
A rule that disallows comparison to booleans.
For example, these are considered invalid:
foo == true
bar != false
false === baz
This is because these expressions evaluate to true
or false
, so you
could get the same result by using either the variable directly,
or negating the variable.
Defined in:
ameba/rules/comparison_to_boolean.crInstance Method Summary
Instance methods inherited from struct Ameba::Rule
catch(source : Source)
catch,
initialize
initialize,
name
name,
test(source : Source, node : Crystal::ASTNode)test(source : Source) test