Skip to main content

Module edit_trailer

Module edit_trailer 

Source
Expand description

Machine-readable line counts at the end of a file-mutating tool result.

write, edit and apply_patch end a successful result with a line of the form [+12 -3]; the session sums these into its edit statistics. The counts are what the tool replaced (an edit counts the whole replaced block), not a minimal diff, so consumers label them approximate.

Functionsยง

edit_trailer
[+added -removed], placed on its own line at the end of a result.
parse_edit_trailers
Sum every [+N -M] line in content (a multi-file patch emits one per file). None when there is no trailer at all.