Skip to content

Commit 3705d71

Browse files
committed
Add Codecov config for enhanced PR coverage checks
This config file sets up Codecov to post detailed coverage status and comments on PRs. It ensures project-wide coverage is monitored, not just changes, enforcing no coverage drop tolerance to maintain code quality.
1 parent ca52518 commit 3705d71

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/.codecov.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## Codecov configuration for a Rust project
2+
#
3+
# This file tells Codecov how to post status checks and comments on
4+
# pull requests. It lives in the root of the repository so that
5+
# Codecov can automatically pick it up. According to Codecov’s
6+
# documentation, repository‑level configuration must be stored in a
7+
# `codecov.yml` or `.codecov.yml` file at the root, `dev/`, or
8+
# `.github/` directory of the repository.
9+
10+
# Show a project‑wide coverage status on every pull request. By
11+
# default Codecov only posts coverage for the lines changed in the PR
12+
# (“patch” coverage). The `coverage.status.project` section below
13+
# enables an additional status check for the entire project. Setting
14+
# `target: auto` means the required coverage is based on the base
15+
# commit’s coverage; `threshold: 0%` means no drop in coverage is
16+
# tolerated; and `base: auto` makes Codecov choose the correct base
17+
# commit.
18+
coverage:
19+
status:
20+
project:
21+
default:
22+
# Use the base commit’s coverage as the target. This causes
23+
# Codecov to flag decreases in overall coverage on a pull
24+
# request. You can change this to a fixed number (e.g. 80%)
25+
# if your project has a minimum coverage requirement.
26+
target: auto
27+
# Allow no percentage drop from the target; increase this if
28+
# minor drops should still pass. Thresholds are specified as
29+
# percentages (e.g. 1% would allow the coverage to drop by
30+
# one percentage point).
31+
threshold: 0%
32+
# Use Codecov’s default base selection for comparisons. The
33+
# `base` key is deprecated but remains in examples to clarify
34+
# behavior.
35+
base: auto
36+
37+
# Configure the pull request comment so that Codecov includes project
38+
# coverage information. Without this, the comment only shows the
39+
# coverage of the changed lines. The options below follow the
40+
# example in Codecov’s common configuration recipes:
41+
comment:
42+
# The order in which information is shown in the PR comment. The
43+
# "diff" section shows changes to lines in the pull request, the
44+
# "flags" section lists flag‑specific coverage if you use flags, and
45+
# the "files" section lists files and their coverage. Including
46+
# "files" ensures that project‑wide coverage appears in the comment.
47+
layout: "diff, flags, files"
48+
# Use default behavior; this means Codecov will always post a
49+
# comment when coverage reports are uploaded.
50+
behavior: default
51+
# Post the comment even if coverage did not change. Set this to
52+
# true if you only want comments on coverage changes.
53+
require_changes: false
54+
# Allow comments when no base coverage report exists.
55+
require_base: false
56+
# Require a coverage report on the head commit before posting a
57+
# comment.
58+
require_head: true
59+
# Show project coverage in the comment. Setting this to true hides
60+
# project coverage and only shows the patch coverage; leaving it
61+
# false makes the project coverage visible.
62+
hide_project_coverage: false

0 commit comments

Comments
 (0)