## TL;DR

The lines your PR added are not covered by tests to the required percentage. Add tests exercising the new branches, or lower the patch target in `codecov.yml` if the team agrees the threshold is wrong.

## Error

```text
Codecov: patch coverage 62.50% (target 80.00%)  -  PR #412
```

## Steps

1. Open the Codecov PR comment and expand the patch section to see exactly which lines are uncovered. Expected: red-highlighted lines in your diff.
2. Add tests that execute those lines, including the branch conditions (both sides of each if). Expected: patch coverage rises.
3. Push and wait for Codecov to re-evaluate. Expected: patch coverage meets the target.
4. If the uncovered lines are genuinely untestable (defensive asserts), exclude them with coverage pragmas or adjust the patch target in codecov.yml.

## When to use

- Codecov fails the PR on patch coverage below target.
- The uncovered lines are in your diff.

## When not to use

- Project coverage dropped but patch is fine  -  that is a different status with a different fix.
- Coverage did not upload at all; fix the upload step first.

## Tool compatibility

- Codecov with patch status checks enabled.
- Any language with a coverage reporter.

## Variant phrasings

### Patch coverage 0% on a docs-only PR

Exclude non-code paths in codecov.yml so docs PRs do not fail.

### Uncovered lines are defensive error branches

Test them with forced-failure cases, or mark them excluded explicitly.

## Why it happens

Patch coverage measures whether the new code in the PR is tested. Gating on it keeps untested code from accumulating, since project-wide coverage can stay high while new code ships uncovered.

## Edge cases

- Chasing 100% patch coverage on trivial getters wastes time; set the target where it actually guards quality.
- Coverage pragmas (`pragma: no cover`) should be rare and justified in review.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst__jifAa5xEgjLtpG9tz5XNw
