• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / ralphex / 21499069074

29 Jan 2026 11:55PM UTC coverage: 80.619% (+0.6%) from 79.976%
21499069074

push

github

umputun
docs: update CLAUDE.md with PLAN_DRAFT workflow and move plan to completed

4218 of 5232 relevant lines covered (80.62%)

125.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.35
/pkg/progress/progress.go
1
// Package progress provides timestamped logging to file and stdout with color support.
2
package progress
3

4
import (
5
        "fmt"
6
        "io"
7
        "os"
8
        "path/filepath"
9
        "strconv"
10
        "strings"
11
        "time"
12

13
        "github.com/dustin/go-humanize"
14
        "github.com/fatih/color"
15
        "golang.org/x/term"
16

17
        "github.com/umputun/ralphex/pkg/config"
18
        "github.com/umputun/ralphex/pkg/processor"
19
)
20

21
// Phase is an alias to processor.Phase for backwards compatibility.
22
//
23
// Deprecated: use processor.Phase directly.
24
type Phase = processor.Phase
25

26
// Phase constants for execution stages - aliases to processor constants.
27
const (
28
        PhaseTask       = processor.PhaseTask
29
        PhaseReview     = processor.PhaseReview
30
        PhaseCodex      = processor.PhaseCodex
31
        PhaseClaudeEval = processor.PhaseClaudeEval
32
        PhasePlan       = processor.PhasePlan
33
)
34

35
// Colors holds all color configuration for output formatting.
36
// use NewColors to create from config.ColorConfig.
37
type Colors struct {
38
        task       *color.Color
39
        review     *color.Color
40
        codex      *color.Color
41
        claudeEval *color.Color
42
        warn       *color.Color
43
        err        *color.Color
44
        signal     *color.Color
45
        timestamp  *color.Color
46
        info       *color.Color
47
        phases     map[Phase]*color.Color
48
}
49

50
// NewColors creates Colors from config.ColorConfig.
51
// all colors must be provided - use config with embedded defaults fallback.
52
// panics if any color value is invalid (configuration error).
53
func NewColors(cfg config.ColorConfig) *Colors {
22✔
54
        c := &Colors{phases: make(map[Phase]*color.Color)}
22✔
55
        c.task = parseColorOrPanic(cfg.Task, "task")
22✔
56
        c.review = parseColorOrPanic(cfg.Review, "review")
22✔
57
        c.codex = parseColorOrPanic(cfg.Codex, "codex")
22✔
58
        c.claudeEval = parseColorOrPanic(cfg.ClaudeEval, "claude_eval")
22✔
59
        c.warn = parseColorOrPanic(cfg.Warn, "warn")
22✔
60
        c.err = parseColorOrPanic(cfg.Error, "error")
22✔
61
        c.signal = parseColorOrPanic(cfg.Signal, "signal")
22✔
62
        c.timestamp = parseColorOrPanic(cfg.Timestamp, "timestamp")
22✔
63
        c.info = parseColorOrPanic(cfg.Info, "info")
22✔
64

22✔
65
        c.phases[PhaseTask] = c.task
22✔
66
        c.phases[PhaseReview] = c.review
22✔
67
        c.phases[PhaseCodex] = c.codex
22✔
68
        c.phases[PhaseClaudeEval] = c.claudeEval
22✔
69
        c.phases[PhasePlan] = c.task // plan phase uses task color (green)
22✔
70

22✔
71
        return c
22✔
72
}
22✔
73

74
// parseColorOrPanic parses RGB string and returns color, panics on invalid input.
75
func parseColorOrPanic(s, name string) *color.Color {
200✔
76
        parseRGB := func(s string) []int {
400✔
77
                if s == "" {
202✔
78
                        return nil
2✔
79
                }
2✔
80
                parts := strings.Split(s, ",")
198✔
81
                if len(parts) != 3 {
203✔
82
                        return nil
5✔
83
                }
5✔
84

85
                // parse each component
86
                r, err := strconv.Atoi(strings.TrimSpace(parts[0]))
193✔
87
                if err != nil || r < 0 || r > 255 {
196✔
88
                        return nil
3✔
89
                }
3✔
90
                g, err := strconv.Atoi(strings.TrimSpace(parts[1]))
190✔
91
                if err != nil || g < 0 || g > 255 {
193✔
92
                        return nil
3✔
93
                }
3✔
94
                b, err := strconv.Atoi(strings.TrimSpace(parts[2]))
187✔
95
                if err != nil || b < 0 || b > 255 {
190✔
96
                        return nil
3✔
97
                }
3✔
98
                return []int{r, g, b}
184✔
99
        }
100

101
        rgb := parseRGB(s)
200✔
102
        if rgb == nil {
216✔
103
                panic(fmt.Sprintf("invalid color_%s value: %q", name, s))
16✔
104
        }
105
        return color.RGB(rgb[0], rgb[1], rgb[2])
184✔
106
}
107

108
// Info returns the info color for informational messages.
109
func (c *Colors) Info() *color.Color { return c.info }
8✔
110

111
// ForPhase returns the color for the given execution phase.
112
func (c *Colors) ForPhase(p Phase) *color.Color { return c.phases[p] }
15✔
113

114
// Timestamp returns the timestamp color.
115
func (c *Colors) Timestamp() *color.Color { return c.timestamp }
17✔
116

117
// Warn returns the warning color.
118
func (c *Colors) Warn() *color.Color { return c.warn }
4✔
119

120
// Error returns the error color.
121
func (c *Colors) Error() *color.Color { return c.err }
3✔
122

123
// Signal returns the signal color.
124
func (c *Colors) Signal() *color.Color { return c.signal }
2✔
125

126
// Logger writes timestamped output to both file and stdout.
127
type Logger struct {
128
        file      *os.File
129
        stdout    io.Writer
130
        startTime time.Time
131
        phase     Phase
132
        colors    *Colors
133
}
134

135
// Config holds logger configuration.
136
type Config struct {
137
        PlanFile        string // plan filename (used to derive progress filename)
138
        PlanDescription string // plan description for plan mode (used for filename)
139
        Mode            string // execution mode: full, review, codex-only, plan
140
        Branch          string // current git branch
141
        NoColor         bool   // disable color output (sets color.NoColor globally)
142
}
143

144
// NewLogger creates a logger writing to both a progress file and stdout.
145
// colors must be provided (created via NewColors from config).
146
func NewLogger(cfg Config, colors *Colors) (*Logger, error) {
23✔
147
        // set global color setting
23✔
148
        if cfg.NoColor {
35✔
149
                color.NoColor = true
12✔
150
        }
12✔
151

152
        progressPath := progressFilename(cfg.PlanFile, cfg.PlanDescription, cfg.Mode)
23✔
153

23✔
154
        // ensure progress files are tracked by creating parent dir
23✔
155
        if dir := filepath.Dir(progressPath); dir != "." {
23✔
156
                if err := os.MkdirAll(dir, 0o750); err != nil {
×
157
                        return nil, fmt.Errorf("create progress dir: %w", err)
×
158
                }
×
159
        }
160

161
        f, err := os.Create(progressPath) //nolint:gosec // path derived from plan filename
23✔
162
        if err != nil {
23✔
163
                return nil, fmt.Errorf("create progress file: %w", err)
×
164
        }
×
165

166
        // acquire exclusive lock on progress file to signal active session
167
        // the lock is held for the duration of execution and released on Close()
168
        if err := lockFile(f); err != nil {
23✔
169
                f.Close()
×
170
                return nil, fmt.Errorf("acquire file lock: %w", err)
×
171
        }
×
172
        registerActiveLock(f.Name())
23✔
173

23✔
174
        l := &Logger{
23✔
175
                file:      f,
23✔
176
                stdout:    os.Stdout,
23✔
177
                startTime: time.Now(),
23✔
178
                phase:     PhaseTask,
23✔
179
                colors:    colors,
23✔
180
        }
23✔
181

23✔
182
        // write header
23✔
183
        planStr := cfg.PlanFile
23✔
184
        if planStr == "" {
43✔
185
                planStr = "(no plan - review only)"
20✔
186
        }
20✔
187
        l.writeFile("# Ralphex Progress Log\n")
23✔
188
        l.writeFile("Plan: %s\n", planStr)
23✔
189
        l.writeFile("Branch: %s\n", cfg.Branch)
23✔
190
        l.writeFile("Mode: %s\n", cfg.Mode)
23✔
191
        l.writeFile("Started: %s\n", time.Now().Format("2006-01-02 15:04:05"))
23✔
192
        l.writeFile("%s\n\n", strings.Repeat("-", 60))
23✔
193

23✔
194
        return l, nil
23✔
195
}
196

197
// Path returns the progress file path.
198
func (l *Logger) Path() string {
27✔
199
        if l.file == nil {
27✔
200
                return ""
×
201
        }
×
202
        return l.file.Name()
27✔
203
}
204

205
// SetPhase sets the current execution phase for color coding.
206
func (l *Logger) SetPhase(phase Phase) {
4✔
207
        l.phase = phase
4✔
208
}
4✔
209

210
// timestampFormat is the format for timestamps: YY-MM-DD HH:MM:SS
211
const timestampFormat = "06-01-02 15:04:05"
212

213
// Print writes a timestamped message to both file and stdout.
214
func (l *Logger) Print(format string, args ...any) {
6✔
215
        msg := fmt.Sprintf(format, args...)
6✔
216
        timestamp := time.Now().Format(timestampFormat)
6✔
217

6✔
218
        // write to file without color
6✔
219
        l.writeFile("[%s] %s\n", timestamp, msg)
6✔
220

6✔
221
        // write to stdout with color
6✔
222
        phaseColor := l.colors.ForPhase(l.phase)
6✔
223
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
6✔
224
        msgStr := phaseColor.Sprint(msg)
6✔
225
        l.writeStdout("%s %s\n", tsStr, msgStr)
6✔
226
}
6✔
227

228
// PrintRaw writes without timestamp (for streaming output).
229
func (l *Logger) PrintRaw(format string, args ...any) {
1✔
230
        msg := fmt.Sprintf(format, args...)
1✔
231
        l.writeFile("%s", msg)
1✔
232
        l.writeStdout("%s", msg)
1✔
233
}
1✔
234

235
// PrintSection writes a section header without timestamp in yellow.
236
// format: "\n--- {label} ---\n"
237
func (l *Logger) PrintSection(section processor.Section) {
1✔
238
        header := fmt.Sprintf("\n--- %s ---\n", section.Label)
1✔
239
        l.writeFile("%s", header)
1✔
240
        l.writeStdout("%s", l.colors.Warn().Sprint(header))
1✔
241
}
1✔
242

243
// getTerminalWidth returns terminal width, using COLUMNS env var or syscall.
244
// Defaults to 80 if detection fails. Returns content width (total - 20 for timestamp).
245
func getTerminalWidth() int {
4✔
246
        const minWidth = 40
4✔
247

4✔
248
        // try COLUMNS env var first
4✔
249
        if cols := os.Getenv("COLUMNS"); cols != "" {
7✔
250
                if w, err := strconv.Atoi(cols); err == nil && w > 0 {
5✔
251
                        contentWidth := w - 20 // leave room for timestamp prefix
2✔
252
                        if contentWidth < minWidth {
3✔
253
                                return minWidth
1✔
254
                        }
1✔
255
                        return contentWidth
1✔
256
                }
257
        }
258

259
        // try terminal syscall
260
        if w, _, err := term.GetSize(int(os.Stdout.Fd())); err == nil && w > 0 {
2✔
261
                contentWidth := w - 20
×
262
                if contentWidth < minWidth {
×
263
                        return minWidth
×
264
                }
×
265
                return contentWidth
×
266
        }
267

268
        return 80 - 20 // default 80 columns minus timestamp
2✔
269
}
270

271
// wrapText wraps text to specified width, breaking on word boundaries.
272
func wrapText(text string, width int) string {
6✔
273
        if width <= 0 || len(text) <= width {
10✔
274
                return text
4✔
275
        }
4✔
276

277
        var result strings.Builder
2✔
278
        words := strings.Fields(text)
2✔
279
        lineLen := 0
2✔
280

2✔
281
        for i, word := range words {
11✔
282
                wordLen := len(word)
9✔
283

9✔
284
                if i == 0 {
11✔
285
                        result.WriteString(word)
2✔
286
                        lineLen = wordLen
2✔
287
                        continue
2✔
288
                }
289

290
                // check if word fits on current line
291
                if lineLen+1+wordLen <= width {
12✔
292
                        result.WriteString(" ")
5✔
293
                        result.WriteString(word)
5✔
294
                        lineLen += 1 + wordLen
5✔
295
                } else {
7✔
296
                        // start new line
2✔
297
                        result.WriteString("\n")
2✔
298
                        result.WriteString(word)
2✔
299
                        lineLen = wordLen
2✔
300
                }
2✔
301
        }
302

303
        return result.String()
2✔
304
}
305

306
// PrintAligned writes text with timestamp on each line, suppressing empty lines.
307
func (l *Logger) PrintAligned(text string) {
2✔
308
        if text == "" {
3✔
309
                return
1✔
310
        }
1✔
311

312
        // trim trailing newlines to avoid extra blank lines
313
        text = strings.TrimRight(text, "\n")
1✔
314
        if text == "" {
1✔
315
                return
×
316
        }
×
317

318
        phaseColor := l.colors.ForPhase(l.phase)
1✔
319

1✔
320
        // wrap text to terminal width
1✔
321
        width := getTerminalWidth()
1✔
322

1✔
323
        // split into lines, wrap each long line, then process
1✔
324
        var lines []string
1✔
325
        for line := range strings.SplitSeq(text, "\n") {
4✔
326
                if len(line) > width {
3✔
327
                        wrapped := wrapText(line, width)
×
328
                        for wrappedLine := range strings.SplitSeq(wrapped, "\n") {
×
329
                                lines = append(lines, wrappedLine)
×
330
                        }
×
331
                } else {
3✔
332
                        lines = append(lines, line)
3✔
333
                }
3✔
334
        }
335

336
        for _, line := range lines {
4✔
337
                if line == "" {
3✔
338
                        continue // skip empty lines
×
339
                }
340

341
                // add indent for list items
342
                displayLine := formatListItem(line)
3✔
343

3✔
344
                // timestamp each line
3✔
345
                timestamp := time.Now().Format(timestampFormat)
3✔
346
                tsPrefix := l.colors.Timestamp().Sprintf("[%s]", timestamp)
3✔
347
                l.writeFile("[%s] %s\n", timestamp, displayLine)
3✔
348

3✔
349
                // use red for signal lines
3✔
350
                lineColor := phaseColor
3✔
351

3✔
352
                // format signal lines nicely
3✔
353
                if sig := extractSignal(line); sig != "" {
3✔
354
                        displayLine = sig
×
355
                        lineColor = l.colors.Signal()
×
356
                }
×
357

358
                l.writeStdout("%s %s\n", tsPrefix, lineColor.Sprint(displayLine))
3✔
359
        }
360
}
361

362
// extractSignal extracts signal name from <<<RALPHEX:SIGNAL_NAME>>> format.
363
// returns empty string if no signal found.
364
func extractSignal(line string) string {
12✔
365
        const prefix = "<<<RALPHEX:"
12✔
366
        const suffix = ">>>"
12✔
367

12✔
368
        start := strings.Index(line, prefix)
12✔
369
        if start == -1 {
18✔
370
                return ""
6✔
371
        }
6✔
372

373
        end := strings.Index(line[start:], suffix)
6✔
374
        if end == -1 {
7✔
375
                return ""
1✔
376
        }
1✔
377

378
        return line[start+len(prefix) : start+end]
5✔
379
}
380

381
// formatListItem adds 2-space indent for list items (numbered or bulleted).
382
// detects patterns like "1. ", "12. ", "- ", "* " at line start.
383
func formatListItem(line string) string {
9✔
384
        trimmed := strings.TrimLeft(line, " \t")
9✔
385
        if trimmed == line { // no leading whitespace
17✔
386
                if isListItem(trimmed) {
12✔
387
                        return "  " + line
4✔
388
                }
4✔
389
        }
390
        return line
5✔
391
}
392

393
// isListItem returns true if line starts with a list marker.
394
func isListItem(line string) bool {
19✔
395
        // check for "- " or "* " (bullet lists)
19✔
396
        if strings.HasPrefix(line, "- ") || strings.HasPrefix(line, "* ") {
23✔
397
                return true
4✔
398
        }
4✔
399
        // check for numbered lists like "1. ", "12. ", "123. "
400
        for i, r := range line {
40✔
401
                if r >= '0' && r <= '9' {
36✔
402
                        continue
11✔
403
                }
404
                if r == '.' && i > 0 && i < len(line)-1 && line[i+1] == ' ' {
19✔
405
                        return true
5✔
406
                }
5✔
407
                break
9✔
408
        }
409
        return false
10✔
410
}
411

412
// Error writes an error message in red.
413
func (l *Logger) Error(format string, args ...any) {
1✔
414
        msg := fmt.Sprintf(format, args...)
1✔
415
        timestamp := time.Now().Format(timestampFormat)
1✔
416

1✔
417
        l.writeFile("[%s] ERROR: %s\n", timestamp, msg)
1✔
418

1✔
419
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
1✔
420
        errStr := l.colors.Error().Sprintf("ERROR: %s", msg)
1✔
421
        l.writeStdout("%s %s\n", tsStr, errStr)
1✔
422
}
1✔
423

424
// Warn writes a warning message in yellow.
425
func (l *Logger) Warn(format string, args ...any) {
1✔
426
        msg := fmt.Sprintf(format, args...)
1✔
427
        timestamp := time.Now().Format(timestampFormat)
1✔
428

1✔
429
        l.writeFile("[%s] WARN: %s\n", timestamp, msg)
1✔
430

1✔
431
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
1✔
432
        warnStr := l.colors.Warn().Sprintf("WARN: %s", msg)
1✔
433
        l.writeStdout("%s %s\n", tsStr, warnStr)
1✔
434
}
1✔
435

436
// LogQuestion logs a question and its options for plan creation mode.
437
// format: QUESTION: <question>\n OPTIONS: <opt1>, <opt2>, ...
438
func (l *Logger) LogQuestion(question string, options []string) {
1✔
439
        timestamp := time.Now().Format(timestampFormat)
1✔
440

1✔
441
        l.writeFile("[%s] QUESTION: %s\n", timestamp, question)
1✔
442
        l.writeFile("[%s] OPTIONS: %s\n", timestamp, strings.Join(options, ", "))
1✔
443

1✔
444
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
1✔
445
        questionStr := l.colors.Info().Sprintf("QUESTION: %s", question)
1✔
446
        optionsStr := l.colors.Info().Sprintf("OPTIONS: %s", strings.Join(options, ", "))
1✔
447
        l.writeStdout("%s %s\n", tsStr, questionStr)
1✔
448
        l.writeStdout("%s %s\n", tsStr, optionsStr)
1✔
449
}
1✔
450

451
// LogAnswer logs the user's answer for plan creation mode.
452
// format: ANSWER: <answer>
453
func (l *Logger) LogAnswer(answer string) {
1✔
454
        timestamp := time.Now().Format(timestampFormat)
1✔
455

1✔
456
        l.writeFile("[%s] ANSWER: %s\n", timestamp, answer)
1✔
457

1✔
458
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
1✔
459
        answerStr := l.colors.Info().Sprintf("ANSWER: %s", answer)
1✔
460
        l.writeStdout("%s %s\n", tsStr, answerStr)
1✔
461
}
1✔
462

463
// LogDraftReview logs the user's draft review action and optional feedback.
464
// format: DRAFT REVIEW: <action>
465
// if feedback is non-empty: FEEDBACK: <feedback>
466
func (l *Logger) LogDraftReview(action, feedback string) {
2✔
467
        timestamp := time.Now().Format(timestampFormat)
2✔
468

2✔
469
        l.writeFile("[%s] DRAFT REVIEW: %s\n", timestamp, action)
2✔
470

2✔
471
        tsStr := l.colors.Timestamp().Sprintf("[%s]", timestamp)
2✔
472
        actionStr := l.colors.Info().Sprintf("DRAFT REVIEW: %s", action)
2✔
473
        l.writeStdout("%s %s\n", tsStr, actionStr)
2✔
474

2✔
475
        if feedback != "" {
3✔
476
                l.writeFile("[%s] FEEDBACK: %s\n", timestamp, feedback)
1✔
477
                feedbackStr := l.colors.Info().Sprintf("FEEDBACK: %s", feedback)
1✔
478
                l.writeStdout("%s %s\n", tsStr, feedbackStr)
1✔
479
        }
1✔
480
}
481

482
// Elapsed returns formatted elapsed time since start.
483
func (l *Logger) Elapsed() string {
24✔
484
        return humanize.RelTime(l.startTime, time.Now(), "", "")
24✔
485
}
24✔
486

487
// Close writes footer, releases the file lock, and closes the progress file.
488
func (l *Logger) Close() error {
23✔
489
        if l.file == nil {
23✔
490
                return nil
×
491
        }
×
492

493
        l.writeFile("\n%s\n", strings.Repeat("-", 60))
23✔
494
        l.writeFile("Completed: %s (%s)\n", time.Now().Format("2006-01-02 15:04:05"), l.Elapsed())
23✔
495

23✔
496
        // release file lock before closing
23✔
497
        _ = unlockFile(l.file)
23✔
498
        unregisterActiveLock(l.file.Name())
23✔
499

23✔
500
        if err := l.file.Close(); err != nil {
23✔
501
                return fmt.Errorf("close progress file: %w", err)
×
502
        }
×
503
        return nil
23✔
504
}
505

506
func (l *Logger) writeFile(format string, args ...any) {
203✔
507
        if l.file != nil {
406✔
508
                fmt.Fprintf(l.file, format, args...)
203✔
509
        }
203✔
510
}
511

512
func (l *Logger) writeStdout(format string, args ...any) {
19✔
513
        fmt.Fprintf(l.stdout, format, args...)
19✔
514
}
19✔
515

516
// getProgressFilename returns progress file path based on plan and mode.
517
func progressFilename(planFile, planDescription, mode string) string {
34✔
518
        // plan mode uses sanitized plan description
34✔
519
        if mode == "plan" && planDescription != "" {
42✔
520
                sanitized := sanitizePlanName(planDescription)
8✔
521
                return fmt.Sprintf("progress-plan-%s.txt", sanitized)
8✔
522
        }
8✔
523

524
        if planFile != "" {
33✔
525
                stem := strings.TrimSuffix(filepath.Base(planFile), ".md")
7✔
526
                switch mode {
7✔
527
                case "codex-only":
2✔
528
                        return fmt.Sprintf("progress-%s-codex.txt", stem)
2✔
529
                case "review":
2✔
530
                        return fmt.Sprintf("progress-%s-review.txt", stem)
2✔
531
                default:
3✔
532
                        return fmt.Sprintf("progress-%s.txt", stem)
3✔
533
                }
534
        }
535

536
        switch mode {
19✔
537
        case "codex-only":
2✔
538
                return "progress-codex.txt"
2✔
539
        case "review":
2✔
540
                return "progress-review.txt"
2✔
541
        case "plan":
2✔
542
                return "progress-plan.txt"
2✔
543
        default:
13✔
544
                return "progress.txt"
13✔
545
        }
546
}
547

548
// sanitizePlanName converts plan description to a safe filename component.
549
// replaces spaces with dashes, removes special characters, and limits length.
550
func sanitizePlanName(desc string) string {
19✔
551
        // lowercase and replace spaces with dashes
19✔
552
        result := strings.ToLower(desc)
19✔
553
        result = strings.ReplaceAll(result, " ", "-")
19✔
554

19✔
555
        // keep only alphanumeric and dashes
19✔
556
        var clean strings.Builder
19✔
557
        for _, r := range result {
331✔
558
                if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '-' {
613✔
559
                        clean.WriteRune(r)
301✔
560
                }
301✔
561
        }
562
        result = clean.String()
19✔
563

19✔
564
        // collapse multiple dashes
19✔
565
        for strings.Contains(result, "--") {
22✔
566
                result = strings.ReplaceAll(result, "--", "-")
3✔
567
        }
3✔
568

569
        // trim leading/trailing dashes
570
        result = strings.Trim(result, "-")
19✔
571

19✔
572
        // limit length to 50 characters
19✔
573
        if len(result) > 50 {
21✔
574
                result = result[:50]
2✔
575
                // don't end with a dash
2✔
576
                result = strings.TrimRight(result, "-")
2✔
577
        }
2✔
578

579
        if result == "" {
21✔
580
                return "unnamed"
2✔
581
        }
2✔
582
        return result
17✔
583
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc