Skip to content

Add support for configurable decimal precision#1468

Merged
hcoles merged 2 commits into
hcoles:masterfrom
see-quick:support-configurable-decimal-precision
Jun 1, 2026
Merged

Add support for configurable decimal precision#1468
hcoles merged 2 commits into
hcoles:masterfrom
see-quick:support-configurable-decimal-precision

Conversation

@see-quick

Copy link
Copy Markdown
Contributor

This change adds a thresholdPrecision parameter (default 0, fully backward compatible) that controls how many decimal places are used when computing and comparing coverage and mutation thresholds.
With integer only thresholds, there is an unavoidable ~1 percentage point blind spot where coverage can silently regress without triggering a build failure.

For example, a project with coverageThreshold=61 won't catch a drop from 61.8% to 61.1% (i.e., both round to 61%).

Moreover, rather than maintaining two parallel APIs (i.e., one returning int, another BigDecimal) the thresholds were changed to BigDecimal throughout. A single path with precision set to 0 produces identical results to the old integer behaviour, so the dual-API approach would add complexity without any behaviour benefit.

Closing #1464.

I have tested local build with my project, and it seems to work fine without any issues. Let me know what you think about it @hcoles. Hopefully I didn't forgot anything.

This is project view I had to make a few CSS/HTLM tweaks but eventually get it worked.

Project view:

project_view

Package view:

package_view

see-quick added 2 commits May 16, 2026 17:46
Signed-off-by: see-quick <maros.orsak159@gmail.com>
…otals

Signed-off-by: see-quick <maros.orsak159@gmail.com>
@see-quick see-quick marked this pull request as ready for review May 19, 2026 08:24
@see-quick

Copy link
Copy Markdown
Contributor Author

Gentle ping @hcoles.

@hcoles

hcoles commented May 22, 2026

Copy link
Copy Markdown
Owner

@see-quick I should be able to look at this next week.

@see-quick

Copy link
Copy Markdown
Contributor Author

Hi @hcoles, just checking in. Any updates on this?

@hcoles hcoles merged commit 5595375 into hcoles:master Jun 1, 2026
6 checks passed
@hcoles

hcoles commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Merged now, thanks.

If you could also raise a PR against

https://github.com/hcoles/pitest-site

To document the changes, that would be helpful.

@see-quick

Copy link
Copy Markdown
Contributor Author

Merged now, thanks.

If you could also raise a PR against

https://github.com/hcoles/pitest-site

To document the changes, that would be helpful.

Yeah, I will try this week, if I find some free cycles. Thanks.

@see-quick

Copy link
Copy Markdown
Contributor Author

Do you think there could be a patch release (i.e., 1.25.4) for this soon?

@hcoles

hcoles commented Jun 9, 2026

Copy link
Copy Markdown
Owner

@see-quick - released now.

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