Presubmit.Source (presubmit v0.2.2)

Copy Markdown View Source

Entry points for the Elixir-aware layers: the structural diff of a commit and the adapter models derived from it.

  • diff/1 — modules and functions added, removed, renamed, changed.
  • models/2 — an adapter's models for the modules a commit added, removed, or modified.
  • find/3 — an adapter's models across a whole tree.

Summary

Types

An adapter's models partitioned by what happened to their modules.

Functions

The structural diff of the commit's Elixir source.

Every model adapter recognises among the modules of tree matching pattern.

Models from adapter for modules the commit added, removed, or modified (renames count as modifications). Modules the adapter does not recognise are skipped; a module that stops or starts being recognised across the change shows up as removed or added respectively.

Types

model_diff()

@type model_diff() :: %{
  added: [struct()],
  removed: [struct()],
  modified: [{struct(), struct()}]
}

An adapter's models partitioned by what happened to their modules.

Functions

diff(commit)

The structural diff of the commit's Elixir source.

find(tree, adapter, pattern \\ Presubmit.Paths.elixir_source())

@spec find(Presubmit.Tree.t(), module(), Presubmit.Pattern.t()) :: [struct()]

Every model adapter recognises among the modules of tree matching pattern.

models(commit, adapter)

@spec models(Presubmit.Commit.t(), module()) :: model_diff()

Models from adapter for modules the commit added, removed, or modified (renames count as modifications). Modules the adapter does not recognise are skipped; a module that stops or starts being recognised across the change shows up as removed or added respectively.