Skip to content

Commit d09f00b

Browse files
cpcloudclaude
andcommitted
fix: address lint findings from rebase
- Replace string concat loop with strings.Repeat (perfsprint) - Use require.Positive/assert.Positive instead of Greater(x, 0) (testifylint) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5be201b commit d09f00b

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

internal/app/extraction_render.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ func (m *Model) buildExtractionPipelineOverlay(
164164
// doesn't shrink when a shorter tab is displayed.
165165
actualLines := strings.Count(previewSection, "\n")
166166
targetLines := previewLines - 2 // -2: sep+blank added as separate parts
167-
for actualLines < targetLines {
168-
previewSection += "\n"
169-
actualLines++
167+
if pad := targetLines - actualLines; pad > 0 {
168+
previewSection += strings.Repeat("\n", pad)
170169
}
171170
}
172171
}

internal/app/extraction_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,9 +3565,9 @@ func TestExploreMode_HintBarTrailingOrder(t *testing.T) {
35653565
pipelineAcceptIdx := hintIndex(pipelinePlain, "accept")
35663566
pipelineExploreIdx := hintIndex(pipelinePlain, "explore")
35673567
pipelineEscIdx := hintIndex(pipelinePlain, "discard")
3568-
require.Greater(t, pipelineAcceptIdx, 0, "accept hint should appear")
3569-
require.Greater(t, pipelineExploreIdx, 0, "explore hint should appear")
3570-
require.Greater(t, pipelineEscIdx, 0, "discard hint should appear")
3568+
require.Positive(t, pipelineAcceptIdx, "accept hint should appear")
3569+
require.Positive(t, pipelineExploreIdx, "explore hint should appear")
3570+
require.Positive(t, pipelineEscIdx, "discard hint should appear")
35713571
assert.Less(t, pipelineAcceptIdx, pipelineExploreIdx,
35723572
"accept should come before explore")
35733573
assert.Less(t, pipelineExploreIdx, pipelineEscIdx,
@@ -3702,7 +3702,7 @@ func TestExploreMode_UnknownTableOverlayStable(t *testing.T) {
37023702
plain := ansi.Strip(out)
37033703
lines := strings.Count(out, "\n")
37043704

3705-
assert.Greater(t, lines, 0, "overlay should render with nonzero height")
3705+
assert.Positive(t, lines, "overlay should render with nonzero height")
37063706
assert.Contains(t, plain, "no operations",
37073707
"should show fallback text for unknown tables")
37083708

0 commit comments

Comments
 (0)