Color a savings percentage according to its value.
(pct: int, enabled: bool)
| 157 | |
| 158 | |
| 159 | def _color_ratio(pct: int, enabled: bool) -> str: |
| 160 | """Color a savings percentage according to its value.""" |
| 161 | code = "32" if pct >= 80 else "33" if pct >= 50 else "31" |
| 162 | return _color(code, f"{pct}%", enabled) |
| 163 | |
| 164 | |
| 165 | def format_savings_report(path: Path | None = None) -> str: |
no test coverage detected