You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5bb0a2
Browse filesBrowse the repository at this point in the historyBrowse files
test(coverage): pin what a deletion-only edit is charged (#3492)
The question was whether an edit that only deletes lines inside a surviving
function scoring >= 30 goes uncharged. Reproduced against real fallow with
`--diff-file`: it goes uncharged, and it is not a gap in this gate's own
attribution. Fallow's diff index holds added lines only — it reports so itself
when handed a deletion-only diff — so no line exists to intersect a function's
span with, and `readTouchedFiles` agrees with the filter it is priced against
rather than overriding it.
So the fix is a pin, not a rule change: charging deletions would need fallow's
own scoping loosened, which would block every function in a file any line of
which changed. Three cases hold the boundary down, each proving with `--all`
that the debt really is in the map rather than absent from it: a deletion
inside the function, lines added elsewhere in the same file, and deleting the
function outright. The first and third pass because removing code retires debt
— the same reason the whole-file and pure-rename exemptions exist. A deletion
that leaves an untested complex function standing is the residual, and `--all`
still lists it.
Part of #3414.
0 commit comments