Expresso.VerifierTransformer (expresso v0.1.0)

Copy Markdown View Source

The Spark transformer that runs the checks that give only errors

It runs one time for each deck module at compile time, after the other transformers. It calls verify/1 of each module of checks/0, and an error stops the compile. More than one error gives one Spark.Error.DslError with the message of each error.

The checks change nothing. They run in a transformer and not as verifiers, because Spark raises an error from a transformer, and the compile stops. Spark runs a verifier in an @after_verify callback, and it reports the error of a verifier as a warning. Expresso.PlacementTransformer gives the same reason. The checks that give only warnings stay verifiers of Expresso.Extension.

Summary

Functions

Run this transformer after each other transformer

Callback implementation for Spark.Dsl.Transformer.before?/1.

Return the modules of the checks that this transformer runs

Run each check on the state of the DSL, and return an error for each error of a check

Functions

after?(arg1)

@spec after?(module()) :: boolean()

Run this transformer after each other transformer

The checks read the steps and the names of the style sheet, which the other transformers write.

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.

before?(_)

Callback implementation for Spark.Dsl.Transformer.before?/1.

checks()

@spec checks() :: [module()]

Return the modules of the checks that this transformer runs

iex> Expresso.Overlay.EffectVerifier in Expresso.VerifierTransformer.checks()
true

transform(dsl_state)

@spec transform(map()) :: {:ok, map()} | {:error, Spark.Error.DslError.t()}

Run each check on the state of the DSL, and return an error for each error of a check