Skip to content

Add precision flag (and config) to control output percentage precision#2991

Merged
ferd merged 1 commit intoerlang:mainfrom
fregate:coverage_precision_opt
Feb 12, 2026
Merged

Add precision flag (and config) to control output percentage precision#2991
ferd merged 1 commit intoerlang:mainfrom
fregate:coverage_precision_opt

Conversation

@fregate
Copy link

@fregate fregate commented Feb 4, 2026

In big codebases, coverage in integers not precise as sometimes CI needs to show increasing or decreasing coverage.

So in this PR I introduce new flag (config option) precision, which can control output precision (0..3 digits after point).

-p [0..3] or --precision=[0..3]

All given numbers are clamped to fit into 0..3 range.

If user provide 0 or not providing this flag all numbers renders as truncated to integer (for backward compability).

Maximum in 3 digits width was choose for simplify commit (do not recalculate table column width with verbose flag ouput) and with a look at other coverage systems (for example for C/C++).

@fregate fregate force-pushed the coverage_precision_opt branch from 139b4c3 to 780c875 Compare February 4, 2026 09:14
Copy link
Collaborator

@ferd ferd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments, mostly minor things.

Let me know what you think, we'll see how to drive this forward.

@fregate fregate force-pushed the coverage_precision_opt branch 2 times, most recently from 870836e to 02f45a2 Compare February 9, 2026 07:52
@fregate fregate force-pushed the coverage_precision_opt branch from 02f45a2 to 07ba473 Compare February 9, 2026 09:22
@ferd ferd merged commit 9c19fb8 into erlang:main Feb 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants