Presubmit.Assertions.Mix (presubmit v0.2.2)

Copy Markdown View Source

Assertions over mix.exs and mix.lock, built on Presubmit.MixFile.

Summary

Functions

Asserts every hex dependency the commit adds to any mix.exs is present in a resulting mix.lock, and every one it removes is absent — the lockfile was regenerated with the change. Umbrella apps share the root lockfile.

Dependencies the commit adds to mix.exs.

Dependencies the commit removes from mix.exs.

The version the commit sets in mix.exs, if it changed it.

Functions

assert_lock_in_sync(commit)

@spec assert_lock_in_sync(Presubmit.Commit.t()) :: :ok

Asserts every hex dependency the commit adds to any mix.exs is present in a resulting mix.lock, and every one it removes is absent — the lockfile was regenerated with the change. Umbrella apps share the root lockfile.

Path and git dependencies without a lock entry are not required to appear.

deps_added(commit)

@spec deps_added(Presubmit.Commit.t()) :: [Presubmit.MixFile.dep()]

Dependencies the commit adds to mix.exs.

deps_removed(commit)

@spec deps_removed(Presubmit.Commit.t()) :: [Presubmit.MixFile.dep()]

Dependencies the commit removes from mix.exs.

version_bump(commit)

@spec version_bump(Presubmit.Commit.t()) :: {String.t() | nil, String.t()} | nil

The version the commit sets in mix.exs, if it changed it.