-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcodecov.yml
More file actions
104 lines (99 loc) · 4.84 KB
/
Copy pathcodecov.yml
File metadata and controls
104 lines (99 loc) · 4.84 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Codecov configuration.
#
# Coverage is produced by the `coverage` job in
# .github/workflows/ci.yml, which uploads codecov.json (region
# coverage) generated by cargo-llvm-cov.
coverage:
status:
# Informational while a baseline settles: Codecov posts the project /
# patch delta as a commit status and a PR comment, but never fails the
# check on a dip. Flip `informational` to false once the baseline is
# trusted and coverage should gate merges.
project:
default:
informational: true
# A fixed floor rather than `auto` (which targets the project figure).
# `auto` is unreachable by construction for a grammar-dispatch patch:
# `AGENTS.md` bans `unwrap` / `expect` in non-test code, so every
# infallible node lookup is spelled `?` — `node.child(1)?` on a
# `parenthesized_expression`, `child_by_field_name("operand")?` on a
# `unary_expression` — and each mints a `None` region no valid input can
# reach. Partials dominate the miss list for that reason (12 of 19 on
# PR #1476). Raising the floor is the fix; adding an `expect` to win the
# region would trade an uncoverable branch for a panic in a library that
# parses untrusted source.
#
# Second thing to know before reading any patch number here: Codecov
# silently drops a file whose diff GitHub's API refuses to send (over
# ~3,000 changed lines), so a heavily-edited file is *absent* from the
# patch rather than counted as missing. The tell is `<ø>` in the
# per-file table instead of a percentage. On PR #1476 that removed
# `src/metrics/abc.rs` — the largest changed file — from the
# denominator entirely (283/303 lines). Production changes to a file of
# that size are invisible to patch coverage; judge them on the covered-
# region delta instead.
patch:
default:
target: 90%
threshold: 2%
informational: true
comment:
layout: "reach, diff, flags, files"
# Skip the comment entirely when a PR does not change coverage, to keep
# noise down on docs-only / CI-only changes.
require_changes: true
# Coverage arrives under two flags from two jobs: `rust` (cargo-llvm-cov,
# always runs) and `python` (pytest-cov, only on PRs that touch the
# bindings). carryforward keeps the python number from vanishing on
# Rust-only PRs, where the python-test job is skipped.
#
# Measurement gap (intentional): the `python` flag measures only the pure-
# Python surface via pytest-cov. The PyO3 *Rust* layer in
# big-code-analysis-py/src/ (lib.rs, vcs.rs, node.rs, ast.rs, sarif.rs) is
# exercised by those same pytest suites, but the crate has no `#[test]`s, so
# `cargo llvm-cov nextest` (which only runs cargo tests) never instruments
# it. Its standalone Rust-line coverage therefore reads far lower than it is
# actually tested — do not "fix" that number by adding redundant cargo tests
# that re-cover behaviour pytest already drives. Closing it for real means
# instrumenting the maturin/pytest run and merging that profdata, tracked
# separately.
flag_management:
default_rules:
carryforward: true
# The python coverage report is written from big-code-analysis-py/ with
# relative paths (python/big_code_analysis/...). Re-root them at the repo
# so Codecov attributes lines to the checked-in files. Rust paths are
# already repo-rooted and are unaffected (the prefix does not match).
fixes:
- "python/big_code_analysis/::big-code-analysis-py/python/big_code_analysis/"
# Exclude vendored grammars, code-generation helpers, and test/build
# harnesses from the coverage denominator so the reported number reflects
# the library's own measurable surface.
ignore:
- "tree-sitter-ccomment/**"
- "tree-sitter-mozcpp/**"
- "tree-sitter-mozjs/**"
- "tree-sitter-preproc/**"
- "tree-sitter-tcl/**"
- "enums/**"
# Belt and braces (#1154). `fuzz/` is workspace-excluded, so
# `cargo llvm-cov --workspace` cannot reach it and no line of it can
# enter either denominator in the first place — but naming it here
# keeps that true if the crate is ever pulled into the workspace, and
# a fuzz target has no meaningful coverage number: it is run by
# libFuzzer, not by the test suite.
- "fuzz/**"
- "xtask/**"
# The benchmark harness, for the same reason as xtask: dev tooling this
# repo authors but never ships, and criterion drives it rather than the
# test suite.
- "big-code-analysis-bench/**"
# The PyO3 crate's *Rust* layer, for the reason the measurement-gap note
# above already gives: pytest exercises it and `cargo llvm-cov nextest`
# cannot see that, so it measures ~52% while being far better tested than
# that implies. Reporting the misleading number would only invite the
# redundant cargo tests that note warns against. The pure-Python surface
# is still measured under the `python` flag.
- "big-code-analysis-py/src/**"
- "**/tests/**"
- "**/build.rs"