Parses the arguments mix publish takes.
Kept apart from the task so the decisions are pure and testable: what the task then does with them touches git, the filesystem and Hex.
Summary
Functions
The checks that run before a release, in the order they run.
The checks named by --skip, or [] when it was not given.
The release step named by the positional arguments.
Types
@type step() :: :major | :minor | :patch | :current | {:version, String.t()}
Functions
@spec checks() :: [String.t()]
The checks that run before a release, in the order they run.
iex> Plumb.Args.checks()
["readme", "format", "test", "docs"]
The checks named by --skip, or [] when it was not given.
Returns {:error, message} naming any check that does not exist, rather than
silently running it.
Examples
iex> Plumb.Args.skipped("format, docs")
{:ok, ["format", "docs"]}
iex> Plumb.Args.skipped(nil)
{:ok, []}
The release step named by the positional arguments.
:current releases the version already in mix.exs rather than bumping — for a
run that bumped, committed, tagged and pushed, then failed to upload.
Examples
iex> Plumb.Args.step(["minor"])
{:ok, :minor}
iex> Plumb.Args.step(["current"])
{:ok, :current}
iex> Plumb.Args.step(["1.2.3"])
{:ok, {:version, "1.2.3"}}