Documentation
¶
Overview ¶
Package difflib computes line-level diffs and a similarity ratio between two texts, with no dependencies.
Two consumers: findings attach a unified-style diff of a changed block so a reviewer or an agent can judge without opening the file (docs/SPEC.md §17), and the matcher uses Ratio to decide `rewritten?` when a def vanished and a similar unmarked block appeared (§16, threshold in config, default 0.8).
The algorithm is a longest-common-subsequence over lines. Blocks are small (a function, a section), so O(n·m) memory is fine and simplicity wins over Myers. Ratio follows difflib's definition, 2·matches/(len(a)+len(b)), so the 0.8 default in the spec means what people expect from Python's difflib.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format renders edits in the familiar `-`/`+`/space prefixed form, one per line, with a trailing newline after each line. An empty script renders "".
func Lines ¶
Lines splits text into lines without a trailing empty element for a final newline, so "a\nb\n" and "a\nb" diff as equal.