MixAffected.Graph.Source behaviour (MixAffected v0.1.0)

Copy Markdown View Source

Behaviour for producing a project's raw file dependency graph.

An adapter returns MixAffected.Graph.adjacency/0 with paths exactly as the toolchain reports them (relative to the project, or to the owning child app at an umbrella root); MixAffected.Graph.build/2 resolves them to root-relative paths. An adapter must never answer {:ok, graph} with a graph it could not fully read: any doubt is {:error, reason}.

Adapters:

Summary

Callbacks

Reads the dependency graph of the compiled project at the absolute path root. Receives the options given to MixAffected.Graph.build/2.

Functions

The adapter for Elixir version: XrefJson from 1.19.0 on, XrefDot before (pre-releases of 1.19 included, since JSON output only shipped in the final release).

Callbacks

fetch(root, opts)

@callback fetch(root :: Path.t(), opts :: keyword()) ::
  {:ok, MixAffected.Graph.adjacency()} | {:error, MixAffected.Graph.error()}

Reads the dependency graph of the compiled project at the absolute path root. Receives the options given to MixAffected.Graph.build/2.

Functions

default(version)

@spec default(String.t()) :: module()

The adapter for Elixir version: XrefJson from 1.19.0 on, XrefDot before (pre-releases of 1.19 included, since JSON output only shipped in the final release).