Commit ba5942f
fix(pr-review): use structural is_test marker, not just name heuristics
codegraph_pr_context classified a caller as a test only when its name
matched test_*/*_test* or its path contained /tests/. Idiomatic Rust unit
tests live in `#[cfg(test)] mod tests` with descriptive names (e.g.
`weighted_mean_l2_math`, `loads_potion_f32_no_weights`), so they were
invisible and every function they cover was reported as "0 coverage".
The indexer already records `is_test` on each function node (from the
language's #[test]/@test marker; helpers.rs:112). Read it via a new
node_props::is_test accessor and prefer it over the name/path heuristics,
which remain as a fallback for languages that don't populate the marker.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 29ee815 commit ba5942f
2 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4104 | 4104 | | |
4105 | 4105 | | |
4106 | 4106 | | |
4107 | | - | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
4108 | 4114 | | |
4109 | 4115 | | |
4110 | 4116 | | |
| |||
4132 | 4138 | | |
4133 | 4139 | | |
4134 | 4140 | | |
4135 | | - | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
4136 | 4146 | | |
4137 | 4147 | | |
4138 | 4148 | | |
| |||
0 commit comments