mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
fix: skip diff coverage when instrumentable lines below minimum
The MIN_LOC=100 threshold checked total diff lines, not instrumentable lines. A commit with many non-instrumentable lines (structs, comments) but only 1-2 instrumentable lines would unfairly fail at 0% coverage. Add a minimum instrumentable lines threshold (5) so the check skips when the sample size is too small to be meaningful.
This commit is contained in:
@@ -148,6 +148,12 @@ awk -v threshold="$THRESHOLD" '
|
||||
exit 0
|
||||
}
|
||||
|
||||
min_instrumentable = 5
|
||||
if (total < min_instrumentable) {
|
||||
printf "Only %d instrumentable lines (< %d minimum) — skipping diff coverage.\n", total, min_instrumentable
|
||||
exit 0
|
||||
}
|
||||
|
||||
uncovered = total - covered
|
||||
pct = (covered / total) * 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user