The logic behind mix presubmit, separated from Mix so it can be
driven from tests: parse arguments, load configuration and change sets,
run, render, and return an exit status.
Summary
Functions
Runs the command line and returns {exit_status, output}.
Types
@type result() :: {exit_status :: 0 | 1 | 2, output :: iodata()}
Functions
Runs the command line and returns {exit_status, output}.
Once the rules have run, the verdict (pass or fail, agreeing with the
exit status) is written to the file named by the PRESUBMIT_VERDICT
environment variable, when it is set. The installed hooks read it to tell a
commit that failed a rule, which they block, from a presubmit that never got
to run, which they let through with a warning: a usage or configuration
error, a crash, or Mix failing to load the project all leave no verdict.
env overrides the environment for tests: ci: (a boolean, else the CI
variable) and verdict: (a path or nil, else PRESUBMIT_VERDICT).