Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ea9835

Browse files
committed
Merge branch 'main' into release/1.3.8
2 parents d23f185 + d6708ff commit 8ea9835

4 files changed

Lines changed: 0 additions & 125 deletions

File tree

internal/render/stdout/constants.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ import (
44
"github.com/fatih/color"
55
)
66

7-
const (
8-
RepoW = 24
9-
BranchW = 30
10-
UncommW = 3
11-
AheadW = 3
12-
BehindW = 3
13-
RemoteStateW = 3 + 3 + 3 + 4 //(uncommited files count + aheadW + behindW + 4 space)
14-
)
15-
167
var (
178
BoldS = color.New(color.Bold).SprintfFunc()
189
DimS = color.New(color.Faint).SprintfFunc()

internal/render/stdout/scanReport.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ func RenderScanReportAsJson(r report.ScanReport) error {
2222
return nil
2323
}
2424

25-
// RenderScanReportAsTable prints a human-readable table view of the ScanReport
26-
// to stdout. The Path column is printed last and not truncated.
27-
func RenderScanReportAsTable(r report.ScanReport) {
28-
totalRepos := len(r.RepoStates)
29-
dirtyRepos := r.DirtyReposCount()
30-
31-
Warnings(r.Warnings)
32-
renderReportHeader(r, totalRepos, dirtyRepos)
33-
34-
if len(r.RepoStates) > 0 {
35-
RenderReposTable(r)
36-
}
37-
38-
if dirtyRepos > 0 {
39-
renderDirtyReposDetails(r)
40-
}
41-
}
42-
4325
func renderReportHeader(r report.ScanReport, totalRepos int, dirtyRepos int) {
4426
fmt.Printf("\n\n")
4527
fmt.Printf("%s\n", BoldS("Repo Scan Report"))
@@ -53,22 +35,6 @@ func renderReportHeader(r report.ScanReport, totalRepos int, dirtyRepos int) {
5335
}
5436
}
5537

56-
func renderDirtyReposDetails(r report.ScanReport) {
57-
fmt.Printf("\n%s\n", CyanBold("Details:"))
58-
for _, rs := range r.RepoStates {
59-
if len(rs.UncommitedFiles) == 0 {
60-
continue
61-
}
62-
fmt.Printf("\n%s %s\n%s %s\n",
63-
MagBold("Repo:"), rs.Repo,
64-
MagBold("Path:"), rs.Path,
65-
)
66-
for _, f := range rs.UncommitedFiles {
67-
fmt.Printf(" %s\n", GrayS("- %s", f))
68-
}
69-
}
70-
}
71-
7238
// truncateRunes truncates to at most n visible runes (avoids breaking alignment with multibyte chars)
7339
func truncateRunes(s string, n int) string {
7440
if n <= 0 {

internal/render/stdout/scanReport_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"io"
77
"os"
8-
"strings"
98
"testing"
109
"time"
1110

@@ -52,19 +51,3 @@ func TestRenderScanReportAsJson_OutputsValidJSON(t *testing.T) {
5251
t.Fatalf("unexpected version: %v", v["Version"])
5352
}
5453
}
55-
56-
func TestRenderScanReportAsTable_PrintsHeaderAndDetails(t *testing.T) {
57-
out := captureStdout(t, func() { RenderScanReportAsTable(sampleReport()) })
58-
if !strings.Contains(out, "Repo Scan Report") {
59-
t.Fatalf("missing header: %s", out)
60-
}
61-
if !strings.Contains(out, "Details:") {
62-
t.Fatalf("missing details section for dirty repos: %s", out)
63-
}
64-
if !strings.Contains(out, "dirty") || !strings.Contains(out, "/tmp/dirty") {
65-
t.Fatalf("missing repo details: %s", out)
66-
}
67-
if !strings.Contains(out, "test warning") {
68-
t.Fatalf("missing warnings: %s", out)
69-
}
70-
}

internal/render/stdout/table.go

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)