|
2 | 2 |
|
3 | 3 | import os |
4 | 4 | import sys |
| 5 | +import time |
5 | 6 | from collections.abc import Mapping, Sequence |
6 | 7 | from concurrent.futures import Future, ProcessPoolExecutor, as_completed |
7 | 8 | from dataclasses import asdict, dataclass |
|
17 | 18 | TextColumn, |
18 | 19 | TimeElapsedColumn, |
19 | 20 | ) |
| 21 | +from rich.rule import Rule |
20 | 22 | from rich.theme import Theme |
21 | 23 |
|
22 | 24 | from . import __version__ |
|
76 | 78 |
|
77 | 79 |
|
78 | 80 | def _make_console(*, no_color: bool) -> Console: |
79 | | - return Console(theme=custom_theme, width=200, no_color=no_color) |
| 81 | + return Console(theme=custom_theme, width=100, no_color=no_color) |
80 | 82 |
|
81 | 83 |
|
82 | 84 | console = _make_console(no_color=False) |
@@ -238,6 +240,8 @@ def _main_impl() -> None: |
238 | 240 | ) |
239 | 241 | sys.exit(ExitCode.CONTRACT_ERROR) |
240 | 242 |
|
| 243 | + t0 = time.monotonic() |
| 244 | + |
241 | 245 | if not args.quiet: |
242 | 246 | print_banner() |
243 | 247 |
|
@@ -749,6 +753,9 @@ def process_sequential(with_progress: bool) -> None: |
749 | 753 | new_func, new_block = baseline_for_diff.diff(func_groups, block_groups) |
750 | 754 | new_clones_count = len(new_func) + len(new_block) |
751 | 755 |
|
| 756 | + if not args.quiet: |
| 757 | + console.print(Rule(style="dim")) |
| 758 | + |
752 | 759 | _print_summary( |
753 | 760 | console=console, |
754 | 761 | quiet=args.quiet, |
@@ -900,6 +907,10 @@ def _write_report_output(*, out: Path, content: str, label: str) -> None: |
900 | 907 | if not args.update_baseline and not args.fail_on_new and new_clones_count > 0: |
901 | 908 | console.print(ui.WARN_NEW_CLONES_WITHOUT_FAIL) |
902 | 909 |
|
| 910 | + if not args.quiet: |
| 911 | + elapsed = time.monotonic() - t0 |
| 912 | + console.print(f"\n[dim]Done in {elapsed:.1f}s[/dim]") |
| 913 | + |
903 | 914 |
|
904 | 915 | def main() -> None: |
905 | 916 | try: |
|
0 commit comments