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
# Codecov configuration.
#
# Coverage is reported by `cargo tarpaulin` in CI. Tarpaulin's line-coverage
# accounting has some known idiosyncrasies — multi-line `return Err(...)`
# continuations, trait default-impl bodies dispatched through `dyn` trait
# objects, and `pub type ... = ...` declarations sometimes appear uncovered
# even when reachable code paths exercise them. The thresholds below are set
# wide enough that those artifacts don't whipsaw the CI status, but tight
# enough that a real regression still fails the gate.
#
# Hard-to-fault-inject error paths (disk full during flush, OS write quotas)
# are also accepted as legitimate exclusions — covering them requires custom
# `Write` implementations that error on demand, which adds more test
# scaffolding than it removes risk.
coverage:
precision: 2
round: down
range: "85...100"
status:
# Whole-crate coverage. Allow 1% absolute regression — tarpaulin numbers
# drift slightly between runs even with identical code, and small refactors
# that introduce one new unreachable error arm shouldn't fail the build.
project:
default:
target: auto
threshold: 1%
if_ci_failed: error
only_pulls: false
# Changed-lines coverage. 80% target with a 5% threshold means new code
# must come with substantive tests (≥75% line coverage of the diff) but
# leaves room for the inevitable handful of error-path lines that aren't
# cheaply fault-injectable.
patch:
default:
target: 80%
threshold: 5%
if_ci_failed: error
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
# Don't report on test files themselves — they trivially have 100% coverage
# (every line of a test function runs when that test runs) and would skew the
# headline percentage.
ignore:
- "tests/**"
- "examples/**"