(items: List[Tuple[int, Path]])
| 863 | return items[: max(0, top_n)] |
| 864 | |
| 865 | def format_sizes_report(items: List[Tuple[int, Path]]) -> str: |
| 866 | total = sum(sz for sz, _ in items) or 1 |
| 867 | lines: List[str] = [] |
| 868 | for i, (sz, p) in enumerate(items, start=1): |
| 869 | pct = (sz * 100.0) / total |
| 870 | lines.append(f"{i:>2}. {format_size(sz):>10} {pct:>6.2f}% {p}") |
| 871 | return "\n".join(lines) if lines else "" |
| 872 | |
| 873 | |
| 874 | # ------------------ Recent files (mtime) ------------------ |
no test coverage detected