Formats the {:error, reason} values returned by composer's modules, and
the warnings returned by Composer.Resolver.warnings/1.
Library functions return errors as data; Mix tasks pass the reason to
message/1 and raise with Mix.raise/1. Every message says what is wrong
and how to fix it.
Summary
Functions
Returns what an error is about: not a position, but the thing to look
for, which Composer.Lint turns into a file and a range.
Returns a human-readable message for an error reason.
Returns a human-readable message for a resolver warning.
Types
@type anchor() :: {:ref, String.t() | nil, String.t()} | {:entry, String.t(), term()} | {:recipe_key, String.t(), atom() | {:if, atom()}} | {:alias, String.t(), atom()} | {:recipe, String.t()} | {:recipe_name, Path.t(), String.t() | atom()} | {:recipe_named, String.t(), String.t()} | {:cycle, [String.t()]} | {:install, String.t(), [{String.t() | nil, String.t()}]} | {:file, Path.t()} | {:file, Path.t(), pos_integer() | nil} | {:step, String.t()} | {:step, String.t(), {:template | :requires | :test, String.t()}} | nil
What an error is about, for placing it in a file (see anchor/1).
Functions
Returns what an error is about: not a position, but the thing to look
for, which Composer.Lint turns into a file and a range.
{:ref, origin, written}- a reference as written in recipeorigin(nilwhen the error does not say; the recipe being checked is meant){:entry, recipe_ref, entry}- a whole step entry{:recipe_key, recipe_ref, key}- one of a recipe's keys;{:if, flag}for anif:flag{:alias, recipe_ref, name}- a cookbook alias{:recipe, recipe_ref}- a recipe's name key{:recipe_name, path, name}- every name keynamein a group file{:recipe_named, cookbook, name}- a recipe namednamein any group ofcookbook{:cycle, chain}- the include that closes a cycle{:install, package, [{origin, label}]}- the installs of a package{:file, path}/{:file, path, line}- a file, or one of its lines{:step, step_ref}/{:step, step_ref, detail}- a step's source, at itsuse Composer.Step, atemplate/1path or arequiresrefnil- nothing to point at
A new error kind gets a message/1 clause and an anchor/1 clause;
a test checks that every message/1 tag has one.
Returns a human-readable message for an error reason.
Returns a human-readable message for a resolver warning.