Adze.Diff (Adze v0.1.0)

Copy Markdown View Source

Line-based unified diff for write-op dry-runs.

Used by Adze.Move, Adze.Extract, and Adze.ExtractPrivate to render the human-/AI-readable preview of a write. Standard unified format with --- a / +++ b headers, @@ -a,n +b,m @@ hunks, and 3 lines of context. Empty string when the inputs are identical.

Summary

Functions

Build a unified diff between two strings. Returns "" when they're identical line-for-line; otherwise an iodata-flattened string with --- a / +++ b headers and one or more hunks.

Functions

unified(before, after_)

@spec unified(String.t(), String.t()) :: String.t()

Build a unified diff between two strings. Returns "" when they're identical line-for-line; otherwise an iodata-flattened string with --- a / +++ b headers and one or more hunks.