Dogma v0.1.16 Dogma.Rule.UnlessElse

A rule that disallows the use of an else block with the unless macro.

For example, the rule considers these valid:

unless something do
  :ok
end

if something do
  :one
else
  :two
end

But it considers this one invalid as it is an unless with an else:

unless something do
  :one
else
  :two
end

The solution is to swap the order of the blocks, and change the unless to an if, so the previous invalid example would become this:

if something do
  :two
else
  :one
end

Summary

Functions

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

Functions

test(rule, script)

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