Skip to content

Commit 38852c1

Browse files
committed
docs(coverage): name the deletion-only edit in the CRAP gate's wording
The paragraph said a deletion's raised score waits in the `--all` backlog, and read the way the reviewer did: only added lines are charged, so a deletion is never. That holds for a deletion-only edit and for a mixed one whose added lines stay outside the function -- `run.test.ts` pins exactly that mixed case, adding below `score` while deleting inside it, and the run is green. It does not hold for added lines inside the function, which is charged the post-deletion score. Names both halves so the conditional is visible rather than inferred from "Adding lines is what charges a function", per the reviewer's optional wording on #3501. Kept the mixed-edit clause because dropping it would overstate the exemption the same paragraph is there to bound.
1 parent 6083b1d commit 38852c1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ those is a stale coverage run, not a debt you owe: re-run `pnpm test:coverage` o
254254
re-check. What does count as debt is editing a function that already scores 30 or more — the score
255255
does not have to be new. Adding lines is what charges a function; deleting is not, and removing a
256256
whole function takes its score with it. The two still interact: a charged function is scored as it
257-
stands after your deletions, and dropping lines that used to be covered can raise that number. Where
258-
no added line lands inside the function, the deletion stays out of the PR entirely and whatever the
259-
score rose to waits in the `--all` backlog. Moving a file without editing its lines touches none of
260-
its functions. Unlike the changed-line gate, this one has no `coverage-waiver` label: the only way
261-
past a score is to test or simplify the function, or to exempt the file in `fallow-crap.json`.
257+
stands after your deletions, and dropping lines that used to be covered can raise that number. A
258+
deletion-only edit is therefore never charged, and neither is a mixed one so long as no added line
259+
lands inside that function — the deletion stays out of the PR and whatever the score rose to waits
260+
in the `--all` backlog. Moving a file without editing its lines touches none of its functions.
261+
Unlike the changed-line gate, this one has no `coverage-waiver` label: the only way past a score is
262+
to test or simplify the function, or to exempt the file in `fallow-crap.json`.
262263

263264
Two things are listed rather than blocked, so a green run does not mean they were checked. A touched
264265
function in a file coverage never instrumented — one `coverage.exclude` drops, or one a stale local

0 commit comments

Comments
 (0)