Skip to content

Commit 8294049

Browse files
committed
super table formatting
1 parent 800b4d8 commit 8294049

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

internal/cmd/root.go

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,12 @@ func displayTableStats(stats *StatsCollector) {
538538
// Print summary row in table style
539539
summaryLabel := fmt.Sprintf("%-*s", repoCol, "Summary")
540540
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-
}
541+
// Skipped: just a single total value number
542+
totalSkipped := stats.PRsSkippedMergeConflict + stats.PRsSkippedCriteria
543+
summarySkipped := fmt.Sprintf("%d", totalSkipped)
545544
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-
}
545+
// Status: count like "3 repos"
546+
summaryStatus := fmt.Sprintf("%d repos", stats.ReposProcessed)
550547
summaryStatus = fmt.Sprintf("%-*s", colWidths[3], summaryStatus)
551548
fmt.Printf(
552549
"│ %-*s │ %s │ %s │ %s │\n",
@@ -559,19 +556,12 @@ func displayTableStats(stats *StatsCollector) {
559556
// Print horizontal line (same as sep) to section off PR links
560557
fmt.Println(sep)
561558

562-
// Print PR links block in table style
559+
// Print PR links block: no vertical lines, just one PR link per line in the bottom section of the table
563560
if len(stats.CombinedPRLinks) > 0 {
564561
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-
}
562+
fmt.Printf("│ %-*s │\n", repoCol, prLinksLabel)
563+
for _, link := range stats.CombinedPRLinks {
564+
fmt.Printf("│ %-*s │\n", repoCol, link)
575565
}
576566
}
577567

0 commit comments

Comments
 (0)