A contiguous run of changed lines within one file, with zero context.
Line numbers on :del lines refer to the before-tree file; those on
:add lines refer to the after-tree file, so an assertion can report
path:line for the version of the file that will exist after the commit.
Summary
Functions
All added lines across hunks, in order.
Computes hunks between two texts using a line-level Myers diff.
All removed lines across hunks, in order.
Types
@type line() :: {:add | :del, pos_integer(), String.t()}
@type t() :: %Presubmit.Hunk{ lines: [line()], new_count: non_neg_integer(), new_start: non_neg_integer(), old_count: non_neg_integer(), old_start: non_neg_integer() }
Functions
@spec added_lines([t()]) :: [{pos_integer(), String.t()}]
All added lines across hunks, in order.
Computes hunks between two texts using a line-level Myers diff.
Both inputs are split on \n; a trailing newline does not produce an
empty final line.
@spec removed_lines([t()]) :: [{pos_integer(), String.t()}]
All removed lines across hunks, in order.