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

Copy Markdown View Source

MixAffected.Graph.Source over mix xref graph --format dot, the adapter for Elixir 1.18 (which has no JSON format).

The dot output lists every source file as a node line and every dependency as an edge line; compile and export edges are labelled, runtime edges are not:

digraph "xref graph" {
  "lib/a.ex"
  "lib/a.ex" -> "lib/b.ex"
  "lib/b.ex" -> "lib/a.ex" [label="(compile)"]
  "lib/c.ex" -> "lib/a.ex" [label="(export)"]
}

Any line outside that shape is a {:parse_error, line}.

Summary

Functions

Parses mix xref graph --format dot output into adjacency.

Functions

parse(dot)

@spec parse(String.t()) ::
  {:ok, MixAffected.Graph.adjacency()} | {:error, MixAffected.Graph.error()}

Parses mix xref graph --format dot output into adjacency.