Dogma v0.1.16 Dogma.Rule.LiteralInCondition

A rule that disallows useless conditional statements that contain a literal in place of a variable or predicate function.

This is because a conditional construct with a literal predicate will always result in the same behaviour at run time, meaning it can be replaced with either the body of the construct, or deleted entirely.

This is considered invalid:

if "something" do
  my_function(bar)
end

Summary

Functions

Callback implementation for c:Dogma.Rule.test/2

Functions

test(rule, script)

Callback implementation for c:Dogma.Rule.test/2.