Dogma.Rule.ComparisonToBoolean
A rule that disallows comparison to booleans.
For example, these are considered invalid:
foo == true
true != bar
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.
Additionally, with a duck typed language such as Elixir, we should be more
interested in whether something is “truthy” or “falsey” than if they are
true
or false
.
Summary
test(script, list2 \\ []) | Callback implementation for |
Functions
Callback implementation for Dogma.Rule.test/2
.