@@ -532,22 +532,51 @@ func displayTableStats(stats *StatsCollector) {
532
532
}
533
533
fmt .Println (bot )
534
534
535
- // Print summary row
536
- fmt .Printf ("\n Summary: Processed %d repos | Combined: %d | Skipped (MC): %d | Skipped (DNM): %d | Time: %s\n " ,
537
- stats .ReposProcessed ,
538
- stats .PRsCombined ,
539
- stats .PRsSkippedMergeConflict ,
540
- stats .PRsSkippedCriteria ,
541
- stats .EndTime .Sub (stats .StartTime ).Round (time .Second ),
535
+ // Print horizontal line (same as sep) to section off summary
536
+ fmt .Println (sep )
537
+
538
+ // Print summary row in table style
539
+ summaryLabel := fmt .Sprintf ("%-*s" , repoCol , "Summary" )
540
+ summaryCombined := fmt .Sprintf ("%*d" , colWidths [1 ], stats .PRsCombined )
541
+ summarySkipped := fmt .Sprintf ("Skipped (MC): %d, (DNM): %d" , stats .PRsSkippedMergeConflict , stats .PRsSkippedCriteria )
542
+ if len (summarySkipped ) > colWidths [2 ] {
543
+ summarySkipped = summarySkipped [:colWidths [2 ]- 1 ] + "…"
544
+ }
545
+ summarySkipped = fmt .Sprintf ("%-*s" , colWidths [2 ], summarySkipped )
546
+ summaryStatus := fmt .Sprintf ("Processed: %d | Time: %s" , stats .ReposProcessed , stats .EndTime .Sub (stats .StartTime ).Round (time .Second ))
547
+ if len (summaryStatus ) > colWidths [3 ] {
548
+ summaryStatus = summaryStatus [:colWidths [3 ]- 1 ] + "…"
549
+ }
550
+ summaryStatus = fmt .Sprintf ("%-*s" , colWidths [3 ], summaryStatus )
551
+ fmt .Printf (
552
+ "│ %-*s │ %s │ %s │ %s │\n " ,
553
+ repoCol , summaryLabel ,
554
+ summaryCombined ,
555
+ summarySkipped ,
556
+ summaryStatus ,
542
557
)
543
558
544
- // Print PR links block
559
+ // Print horizontal line (same as sep) to section off PR links
560
+ fmt .Println (sep )
561
+
562
+ // Print PR links block in table style
545
563
if len (stats .CombinedPRLinks ) > 0 {
546
- fmt .Println ("\n Links to Combined PRs:" )
547
- for _ , link := range stats .CombinedPRLinks {
548
- fmt .Println ("-" , link )
564
+ prLinksLabel := fmt .Sprintf ("%-*s" , repoCol , "Links to Combined PRs" )
565
+ for i , link := range stats .CombinedPRLinks {
566
+ prLink := link
567
+ if len (prLink ) > colWidths [1 ]+ colWidths [2 ]+ colWidths [3 ]+ 6 {
568
+ prLink = prLink [:colWidths [1 ]+ colWidths [2 ]+ colWidths [3 ]+ 3 ] + "…"
569
+ }
570
+ if i == 0 {
571
+ fmt .Printf ("│ %-*s │ %-*s │\n " , repoCol , prLinksLabel , colWidths [1 ]+ colWidths [2 ]+ colWidths [3 ]+ 6 , prLink )
572
+ } else {
573
+ fmt .Printf ("│ %-*s │ %-*s │\n " , repoCol , "" , colWidths [1 ]+ colWidths [2 ]+ colWidths [3 ]+ 6 , prLink )
574
+ }
549
575
}
550
576
}
577
+
578
+ // Print bottom border
579
+ fmt .Println (bot )
551
580
}
552
581
553
582
// pad returns a string of n runes of s (usually "─")
0 commit comments