Skip to content

Commit 595cd64

Browse files
crrowclaude
andcommitted
fix(lint): evalOrder, goimports, appendCombine
- Extract cmd before return to fix evalOrder warnings - Use goimports -local for proper import grouping - Combine append chains in handlePruneResult - Combine bool params in entryToRow signature Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 921a993 commit 595cd64

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

internal/agentmd/commands.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
"path/filepath"
1010
"sort"
1111

12-
"github.com/rararulab/devkit/internal/config"
1312
"github.com/urfave/cli/v3"
13+
14+
"github.com/rararulab/devkit/internal/config"
1415
)
1516

1617
// Cmd returns the "check-agent-md" command.

internal/deps/commands.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import (
1414
"strconv"
1515

1616
toml "github.com/pelletier/go-toml/v2"
17-
"github.com/rararulab/devkit/internal/config"
1817
"github.com/urfave/cli/v3"
18+
19+
"github.com/rararulab/devkit/internal/config"
1920
)
2021

2122
// Cmd returns the top-level "check-deps" command.

internal/worktree/tui.go

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func newTUIModel(entries []Entry) tuiModel {
222222
return m
223223
}
224224

225-
func entryToRow(e *Entry, selected bool, sizesLoaded bool) table.Row {
225+
func entryToRow(e *Entry, selected, sizesLoaded bool) table.Row {
226226
// Selection indicator column
227227
check := " "
228228
if selected {
@@ -355,32 +355,30 @@ func (m *tuiModel) computeSizesCmd() tea.Cmd {
355355
}
356356

357357
func (m *tuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
358+
var cmd tea.Cmd
358359
switch msg := msg.(type) {
359360
case dismissToastMsg:
360-
return m, m.handleDismissToast(msg)
361+
cmd = m.handleDismissToast(msg)
361362
case dismissMessageMsg:
362-
return m, m.handleDismissMessage(msg)
363+
cmd = m.handleDismissMessage(msg)
363364
case sizeResultMsg:
364-
return m, m.handleSizeResult(msg)
365+
cmd = m.handleSizeResult(msg)
365366
case deleteResultMsg:
366-
return m, m.handleDeleteResult(msg)
367+
cmd = m.handleDeleteResult(msg)
367368
case pruneResultMsg:
368-
return m, m.handlePruneResult(msg)
369+
cmd = m.handlePruneResult(msg)
369370
case reloadResultMsg:
370-
return m, m.handleReloadResult(msg)
371+
cmd = m.handleReloadResult(msg)
371372
case tea.WindowSizeMsg:
372373
m.windowHeight = msg.Height
373374
m.table.SetHeight(m.tableHeight())
374-
return m, nil
375375
case tea.KeyPressMsg:
376-
if m.busy {
377-
return m, nil
376+
if !m.busy {
377+
return m.handleKeyPress(msg)
378378
}
379-
return m.handleKeyPress(msg)
379+
default:
380+
m.table, cmd = m.table.Update(msg)
380381
}
381-
382-
var cmd tea.Cmd
383-
m.table, cmd = m.table.Update(msg)
384382
return m, cmd
385383
}
386384

@@ -431,10 +429,7 @@ func (m *tuiModel) handlePruneResult(msg pruneResultMsg) tea.Cmd {
431429
if msg.err != nil {
432430
return m.pushToast(msg.err.Error())
433431
}
434-
var cmds []tea.Cmd
435-
cmds = append(cmds, m.setMessage("Pruned stale worktree references"))
436-
cmds = append(cmds, m.reloadCmd())
437-
return tea.Batch(cmds...)
432+
return tea.Batch(m.setMessage("Pruned stale worktree references"), m.reloadCmd())
438433
}
439434

440435
func (m *tuiModel) handleReloadResult(msg reloadResultMsg) tea.Cmd {

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import (
66
"log"
77
"os"
88

9+
"github.com/urfave/cli/v3"
10+
911
"github.com/rararulab/devkit/internal/agentmd"
1012
"github.com/rararulab/devkit/internal/deps"
1113
"github.com/rararulab/devkit/internal/worktree"
12-
"github.com/urfave/cli/v3"
1314
)
1415

1516
func main() {

0 commit comments

Comments
 (0)