fix(lint): resolve goconst findings for checkpoint/trail · Entire

fix(lint): resolve goconst findings for checkpoint/trail

77cada3→main·

pfleidi·2w ago·2 files·+10 added/-6 removed

Recent refactors pushed the repeated "checkpoint" and "trail" string literals over goconst's occurrence threshold, breaking CI lint.

Reuse the existing pluralize helper in reviewContextCheckpointNoun (which also drops a duplicated helper), and name the tune-source tokens as constants in parseTuneSources.

Sessions

3252f900eb45View transcript

[?
Fix Goconst Lint Findings for CheckpointClaude Code·Opus 4.8[1m]·2 steps](/content/gh/entireio/cli/session/3d46af4b-aee9-4d95-8973-da943551ed23#timeline-3252f900eb45/index.html)

Changes

2

378 unmodified lines

379
380
381
382
383
384
385
382
383
384
385

378 unmodified lines

}

func reviewContextCheckpointNoun(count int) string {
    if count == 1 {
        return "checkpoint"
    }
    return "checkpoints"
    return pluralize("checkpoint", count)
}

func reviewContextCommitMessages(ctx context.Context, repoRoot string, scopeBaseRef string, maxCommits int) ([]string, bool, error) {

Mcmd/entire/cli/review_context.go+1/-4

24 unmodified lines

25
26
27
28
29
30
31
32
33
34
35
36
37
21 unmodified lines

59
60
61
55
62
63
57
64
65
66
67

24 unmodified lines

tuneMaxTrailsForFindings = 8  // trails to pull findings from in the trails tier
)

const (
    sourceCheckpoint  = "checkpoint"
    sourceCheckpoints = "checkpoints"
    sourceTrail       = "trail"
    sourceTrails      = "trails"
)

// tuneSources selects which data tiers gatherTuningContext collects.
type tuneSources struct {
    repo        bool
21 unmodified lines

s.repo = true
        case "pr", "prs", "issue", "issues":
        s.prs = true
        case "checkpoint", "checkpoints":
        case sourceCheckpoint, sourceCheckpoints:
            s.checkpoints = true
        case "trail", "trails":
        case sourceTrail, sourceTrails:
            s.trails = true
        default:
            return s, fmt.Errorf("unknown source %q (valid: repo, prs, checkpoints, trails, all)", item)

Mcmd/entire/cli/runner_gather.go+9/-2