diff --git a/README.md b/README.md index 2b2c2db..90144d4 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,7 @@ A checked entry is implemented on `main` and is included in the next release; pu - Rules now sit under Ignoring checks with noqa comments, the Glossary under Command line options, and Decorator matching is more concise. - Python 3.10+ requirement is now shown as a badge in the README - **v2.5.0** `2026-11-07`: + - Stop Codecov report comments on pull requests with no coverage findings - Bugfixes: - Fix a crash when a decorator has no `id` attribute. - **v2.4.1** `2024-08-09`: diff --git a/codecov.yml b/codecov.yml index fd75cb0..aa7e614 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,4 +1,7 @@ +# Codecov pull-request comment policy. +# Comment only when the patch itself contains uncovered lines. An unchanged +# project delta or a fully covered patch is not a finding and posts nothing. comment: - require_changes: true + require_changes: "uncovered_patch" require_base: true require_head: true diff --git a/docs/features.md b/docs/features.md index 5719288..28f4b3a 100644 --- a/docs/features.md +++ b/docs/features.md @@ -70,3 +70,14 @@ other line is covered by a test that asserts an observable value or output, not `make coverage-new BASE_BRANCH=origin/main` enforces 100% diff coverage for newly introduced package lines, and the pytest gate enforces 100% package coverage for the whole suite. A defensive branch that a test cannot reach must be justified in the specification before it receives a pragma; lowering the threshold is not an option. + +Codecov pull-request comments are configured to post only when the patch itself has uncovered lines. The setting lives in the repository-root +`codecov.yml` as `comment.require_changes: "uncovered_patch"`; an unchanged project delta or a fully covered patch is not a finding and posts +nothing. `require_base` and `require_head` are report-existence guards, not change gates, so they cannot by themselves silence a no-findings +comment. Codecov reads repository YAML only from the repository root, `dev/`, or `.github/`, and only from the default branch (`main`). + +When a no-findings pull request still receives a comment, escalate in this order. First, read the authenticated configuration at +`GET https://api.codecov.io/api/v2/github/albertas/repos/deadcode/config/` or the Codecov UI to see which YAML is effective. Second, if the +repository YAML is ignored, set `comment: false` in the same file. +Third, if comments persist with `comment: false`, install the Codecov GitHub App so comments use the supported path. The rollback is `git revert` +of the single configuration commit, which restores `require_changes: true`.