Reach.Check.Changed.Range (Reach v2.8.1)

Copy Markdown View Source

Represents old- and new-side line counts for a changed diff hunk.

Summary

Types

t()

@type t() :: %Reach.Check.Changed.Range{
  new_count: non_neg_integer(),
  new_start: non_neg_integer(),
  old_count: non_neg_integer(),
  old_start: non_neg_integer()
}

Functions

change_line_count(range)

@spec change_line_count(t()) :: non_neg_integer()

contains_line?(range, atom, line)

@spec contains_line?(t(), :old | :new, pos_integer()) :: boolean()

current_lines(range)

@spec current_lines(t()) :: {non_neg_integer(), non_neg_integer()} | nil

new(attrs)

@spec new(keyword() | map()) :: t()

normalize(range)

@spec normalize(t() | {pos_integer(), pos_integer()}) :: t()