style: apply gofmt formatting

This commit is contained in:
Willie
2026-03-17 04:48:42 +08:00
parent 26804547b3
commit 23e43fc976
16 changed files with 40 additions and 45 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ func formatCategoryBreakdownTUI(cats map[string]int) string {
if cc.count > 50 {
parts[i] = tc.Emphasis.Bold(true).Render(label+":") + tc.Emphasis.Bold(true).Render(fmt.Sprintf("%d", cc.count))
} else {
parts[i] = tc.Dim.Render(label+":"+fmt.Sprintf("%d", cc.count))
parts[i] = tc.Dim.Render(label + ":" + fmt.Sprintf("%d", cc.count))
}
}
return strings.Join(parts, " ")
-1
View File
@@ -51,7 +51,6 @@ func (i auditItem) Title() string {
return tc.Yellow.Render("!") + " " + name
}
// compactAuditPath strips tracked repo prefix (first segment starting with "_")
// and keeps at most the last 2 segments.
func compactAuditPath(name string) string {
+2 -2
View File
@@ -508,9 +508,9 @@ func diffOutputJSON(results []targetDiffResult, start time.Time) error {
func diffOutputJSONWithExtras(results []targetDiffResult, extrasResults []extraDiffResult, start time.Time) error {
type outputWithExtras struct {
Targets []diffJSONTarget `json:"targets"`
Targets []diffJSONTarget `json:"targets"`
Extras []extraDiffJSONEntry `json:"extras,omitempty"`
Duration string `json:"duration"`
Duration string `json:"duration"`
}
o := outputWithExtras{
Duration: formatDuration(start),
-1
View File
@@ -140,7 +140,6 @@ func collectExtrasDiff(extras []config.ExtraConfig, sourceResolver func(string)
return results
}
// renderExtrasDiffPlain renders extras diff in plain text.
func renderExtrasDiffPlain(results []extraDiffResult) {
fmt.Println()
-1
View File
@@ -51,4 +51,3 @@ Options:
--global, -g Use global extras (~/.config/skillshare/)
--help, -h Show this help`)
}
-1
View File
@@ -219,4 +219,3 @@ Options:
--global, -g Use global extras (~/.config/skillshare/)
--help, -h Show this help`)
}
+1 -1
View File
@@ -21,7 +21,7 @@ func (i extraTUIItem) Description() string { return "" }
type extrasListDelegate struct{}
func (extrasListDelegate) Height() int { return 1 }
func (extrasListDelegate) Spacing() int { return 1 }
func (extrasListDelegate) Spacing() int { return 1 }
func (extrasListDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd { return nil }
func (extrasListDelegate) Render(w io.Writer, m list.Model, index int, item list.Item) {
+5 -3
View File
@@ -47,7 +47,7 @@ func (g *globalInstallContext) Reconcile() error {
}
func (g *globalInstallContext) PostInstallSkill(string) error { return nil }
func (g *globalInstallContext) Mode() string { return "global" }
func (g *globalInstallContext) GitLabHosts() []string { return g.cfg.EffectiveGitLabHosts() }
func (g *globalInstallContext) GitLabHosts() []string { return g.cfg.EffectiveGitLabHosts() }
// ---------------------------------------------------------------------------
// projectInstallContext
@@ -71,5 +71,7 @@ func (p *projectInstallContext) PostInstallSkill(displayName string) error {
filepath.Join("skills", displayName),
)
}
func (p *projectInstallContext) Mode() string { return "project" }
func (p *projectInstallContext) GitLabHosts() []string { return p.runtime.config.EffectiveGitLabHosts() }
func (p *projectInstallContext) Mode() string { return "project" }
func (p *projectInstallContext) GitLabHosts() []string {
return p.runtime.config.EffectiveGitLabHosts()
}
+1 -1
View File
@@ -48,7 +48,7 @@ func writeJSONError(err error) error {
fmt.Fprintf(os.Stderr, "json marshal error: %v\n", merr)
fmt.Printf("{\"error\": %q}\n", err.Error())
} else {
os.Stdout.Write(out) //nolint:errcheck
os.Stdout.Write(out) //nolint:errcheck
os.Stdout.Write([]byte("\n")) //nolint:errcheck
}
return &jsonSilentError{cause: err}
+1 -1
View File
@@ -150,7 +150,7 @@ func printUsage() {
// Colors
y := "\033[33m" // yellow - commands
c := "\033[36m" // cyan - arguments
g := ui.Dim // dim
g := ui.Dim // dim
r := "\033[0m" // reset
// ASCII art logo
-1
View File
@@ -144,4 +144,3 @@ func formatRiskBadgeLipgloss(label string) string {
}
return " " + riskLabelStyle(label).Render("["+label+"]")
}
-1
View File
@@ -1150,7 +1150,6 @@ func logUninstallOp(cfgPath string, names []string, succeeded int, start time.Ti
oplog.WriteWithLimit(cfgPath, oplog.OpsFile, e, logMaxEntries()) //nolint:errcheck
}
func printUninstallHelp() {
fmt.Println(`Usage: skillshare uninstall <name>... [options]
skillshare uninstall --group <group> [options]