-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodecov.yaml
More file actions
79 lines (71 loc) · 1.94 KB
/
codecov.yaml
File metadata and controls
79 lines (71 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
codecov:
# # Ensures coverage is only uploaded if CI passes (e.g., tests succeed).
require_ci_to_pass: true
coverage:
# Rounds coverage to 2 decimal places (e.g., 85.43%).
precision: 2
# Rounds down for conservative estimates.
round: down
# 40%+ green, below yellow, <20% red.
range: "40...70"
status:
# Overall project coverage.
project:
default:
# Aim for 50% coverage across the project.
target: 50%
# Allow 5% drop due to uncovered new code before failing.
threshold: 5%
# Compare against the base branch (e.g., main).
base: auto
# Apply to these branches.
branches:
- main
# Fail if CI fails.
if_ci_failed: error
# Coverage for new code in PRs.
patch:
default:
# Require 70% of new/changed code in PRs to be covered.
target: 70%
# Allow 5% uncovered new code before failing.
threshold: 5%
# Only apply to pull requests.
only_pulls: true
# Detect unexpected coverage changes outside the PR diff.
changes:
default:
enabled: true
comment:
# Customize PR comment layout.
layout: "reach, diff, flags, files"
# Post comment on PRs with coverage info.
behavior: default
# Only comment if coverage changes.
require_changes: true
parsers:
# For Go projects using `go test -cover` + `gocov`.
gcov:
branch_detection:
# Detect branch coverage if available.
conditional: yes
# Include loops in branch detection.
loop: yes
# Exclude method-level granularity.
method: no
# Exclude macros.
macro: no
# Exclude files/directories from coverage.
ignore:
# Markdown files
- "*.md"
# Ignore all mocks subdirectories.
- "**/mocks/*"
# Categorize coverage by module
flags:
# Internal utilities and actions
internal:
paths:
- "internal/*"
# Persist coverage across commits
carryforward: true