diff --git a/cmd/skillshare/audit_render.go b/cmd/skillshare/audit_render.go index 20e39465d..476385667 100644 --- a/cmd/skillshare/audit_render.go +++ b/cmd/skillshare/audit_render.go @@ -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, " ") diff --git a/cmd/skillshare/audit_tui.go b/cmd/skillshare/audit_tui.go index 1fab09e0b..1ca13cd7c 100644 --- a/cmd/skillshare/audit_tui.go +++ b/cmd/skillshare/audit_tui.go @@ -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 { diff --git a/cmd/skillshare/diff.go b/cmd/skillshare/diff.go index 6bddf32bd..9d4302f25 100644 --- a/cmd/skillshare/diff.go +++ b/cmd/skillshare/diff.go @@ -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), diff --git a/cmd/skillshare/diff_extras.go b/cmd/skillshare/diff_extras.go index 311a9cb53..8aaffd4f2 100644 --- a/cmd/skillshare/diff_extras.go +++ b/cmd/skillshare/diff_extras.go @@ -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() diff --git a/cmd/skillshare/extras.go b/cmd/skillshare/extras.go index 0bd3ac4cc..5bc6e3a31 100644 --- a/cmd/skillshare/extras.go +++ b/cmd/skillshare/extras.go @@ -51,4 +51,3 @@ Options: --global, -g Use global extras (~/.config/skillshare/) --help, -h Show this help`) } - diff --git a/cmd/skillshare/extras_list.go b/cmd/skillshare/extras_list.go index 9920fa217..61108827f 100644 --- a/cmd/skillshare/extras_list.go +++ b/cmd/skillshare/extras_list.go @@ -219,4 +219,3 @@ Options: --global, -g Use global extras (~/.config/skillshare/) --help, -h Show this help`) } - diff --git a/cmd/skillshare/extras_list_tui_item.go b/cmd/skillshare/extras_list_tui_item.go index 0cb676dcf..253f70391 100644 --- a/cmd/skillshare/extras_list_tui_item.go +++ b/cmd/skillshare/extras_list_tui_item.go @@ -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) { diff --git a/cmd/skillshare/install_context.go b/cmd/skillshare/install_context.go index 34dd1c0a1..0088989a8 100644 --- a/cmd/skillshare/install_context.go +++ b/cmd/skillshare/install_context.go @@ -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() +} diff --git a/cmd/skillshare/json_output.go b/cmd/skillshare/json_output.go index cf1323a5c..c930b4934 100644 --- a/cmd/skillshare/json_output.go +++ b/cmd/skillshare/json_output.go @@ -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} diff --git a/cmd/skillshare/main.go b/cmd/skillshare/main.go index 333146c5d..3c4e77381 100644 --- a/cmd/skillshare/main.go +++ b/cmd/skillshare/main.go @@ -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 diff --git a/cmd/skillshare/tui_colors.go b/cmd/skillshare/tui_colors.go index 83e720e8b..811e733af 100644 --- a/cmd/skillshare/tui_colors.go +++ b/cmd/skillshare/tui_colors.go @@ -144,4 +144,3 @@ func formatRiskBadgeLipgloss(label string) string { } return " " + riskLabelStyle(label).Render("["+label+"]") } - diff --git a/cmd/skillshare/uninstall.go b/cmd/skillshare/uninstall.go index be0bfe895..2f712f066 100644 --- a/cmd/skillshare/uninstall.go +++ b/cmd/skillshare/uninstall.go @@ -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 ... [options] skillshare uninstall --group [options] diff --git a/internal/config/config.go b/internal/config/config.go index 569143a3e..3197d457d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -59,14 +59,14 @@ type ExtraConfig struct { // Config holds the application configuration type Config struct { - Source string `yaml:"source"` - Mode string `yaml:"mode,omitempty"` // default mode: merge - Targets map[string]TargetConfig `yaml:"targets"` - Extras []ExtraConfig `yaml:"extras,omitempty"` - Ignore []string `yaml:"ignore,omitempty"` - Audit AuditConfig `yaml:"audit,omitempty"` - Hub HubConfig `yaml:"hub,omitempty"` - Log LogConfig `yaml:"log,omitempty"` + Source string `yaml:"source"` + Mode string `yaml:"mode,omitempty"` // default mode: merge + Targets map[string]TargetConfig `yaml:"targets"` + Extras []ExtraConfig `yaml:"extras,omitempty"` + Ignore []string `yaml:"ignore,omitempty"` + Audit AuditConfig `yaml:"audit,omitempty"` + Hub HubConfig `yaml:"hub,omitempty"` + Log LogConfig `yaml:"log,omitempty"` TUI *bool `yaml:"tui,omitempty"` // nil = default true GitLabHosts []string `yaml:"gitlab_hosts,omitempty"` } diff --git a/internal/install/install_test.go b/internal/install/install_test.go index 397040614..6f1f922da 100644 --- a/internal/install/install_test.go +++ b/internal/install/install_test.go @@ -382,9 +382,9 @@ func TestWrapGitError(t *testing.T) { func TestExtractGitFatal(t *testing.T) { tests := []struct { - name string - stderr string - want string + name string + stderr string + want string }{ { name: "fatal line only", diff --git a/internal/server/handler_extras.go b/internal/server/handler_extras.go index 81443717b..eb8713a77 100644 --- a/internal/server/handler_extras.go +++ b/internal/server/handler_extras.go @@ -310,13 +310,13 @@ func (s *Server) handleExtrasSync(w http.ResponseWriter, r *http.Request) { extras := s.extrasConfig() type targetSyncResult struct { - Target string `json:"target"` - Mode string `json:"mode"` - Synced int `json:"synced"` - Skipped int `json:"skipped"` - Pruned int `json:"pruned"` + Target string `json:"target"` + Mode string `json:"mode"` + Synced int `json:"synced"` + Skipped int `json:"skipped"` + Pruned int `json:"pruned"` Errors []string `json:"errors,omitempty"` - Error string `json:"error,omitempty"` + Error string `json:"error,omitempty"` } type extraSyncResult struct { Name string `json:"name"` @@ -370,11 +370,11 @@ func (s *Server) handleExtrasSync(w http.ResponseWriter, r *http.Request) { } s.writeOpsLog("extras-sync", "ok", start, map[string]any{ - "name": body.Name, - "dryRun": body.DryRun, - "force": body.Force, - "count": len(results), - "scope": "ui", + "name": body.Name, + "dryRun": body.DryRun, + "force": body.Force, + "count": len(results), + "scope": "ui", }, "") writeJSON(w, map[string]any{"results": results}) @@ -497,4 +497,3 @@ func (s *Server) handleExtrasDelete(w http.ResponseWriter, r *http.Request) { writeJSON(w, map[string]any{"success": true, "name": name}) } - diff --git a/internal/ui/pterm.go b/internal/ui/pterm.go index 0b1a5e234..a489a290a 100644 --- a/internal/ui/pterm.go +++ b/internal/ui/pterm.go @@ -344,18 +344,18 @@ type ProgressBar struct { } const ( - barWidth = 36 // fixed visible width (character count) - barFill = "■" // U+25A0 filled block - barEmpty = "・" // U+FF65 half-width dot - barColor = "\033[0;36m" // reset + cyan (project accent) - barDim = "\033[36;2m" // cyan + dim for empty dots - barMuted = "\x1b[0;2m" // dim attribute for label + count + barWidth = 36 // fixed visible width (character count) + barFill = "■" // U+25A0 filled block + barEmpty = "・" // U+FF65 half-width dot + barColor = "\033[0;36m" // reset + cyan (project accent) + barDim = "\033[36;2m" // cyan + dim for empty dots + barMuted = "\x1b[0;2m" // dim attribute for label + count barReset = Reset hideCursor = "\x1b[?25l" showCursor = "\x1b[?25h" clearLine = "\r\x1b[2K" barThrottleMs = 50 * time.Millisecond // min interval between renders - barFixedOverhead = barWidth + 8 // bar chars + " NNN% " + padding + barFixedOverhead = barWidth + 8 // bar chars + " NNN% " + padding ) // StartProgress starts a progress bar with the given title and total count.