Skip to content

Commit fed0d2a

Browse files
chore: fix minor formatting issues
- Corrected spacing in several files - Removed unnecessary blank lines - Improved code readability
1 parent 421b7e5 commit fed0d2a

6 files changed

Lines changed: 71 additions & 71 deletions

File tree

internal/core/core_test.go

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
package core
2-
3-
import (
4-
"testing"
5-
"time"
6-
)
7-
8-
func TestDefaultViews(t *testing.T) {
9-
views := DefaultViews(time.Now())
10-
if len(views) == 0 {
11-
t.Error("expected views, got none")
12-
}
13-
}
14-
15-
func TestFilter_ApplyToTask(t *testing.T) {
16-
f := Filter{
17-
Tag: "test",
18-
Priority: new(Priority),
19-
}
20-
*f.Priority = P0
21-
22-
task := Task{Title: "Test Task"}
23-
f.ApplyToTask(&task)
24-
25-
if task.Priority != P0 {
26-
t.Errorf("expected priority P0, got %v", task.Priority)
27-
}
28-
hasTag := false
29-
for _, tg := range task.Tags {
30-
if tg == "test" {
31-
hasTag = true
32-
}
33-
}
34-
if !hasTag {
35-
t.Error("expected tag 'test' not found")
36-
}
37-
}
1+
package core
2+
3+
import (
4+
"testing"
5+
"time"
6+
)
7+
8+
func TestDefaultViews(t *testing.T) {
9+
views := DefaultViews(time.Now())
10+
if len(views) == 0 {
11+
t.Error("expected views, got none")
12+
}
13+
}
14+
15+
func TestFilter_ApplyToTask(t *testing.T) {
16+
f := Filter{
17+
Tag: "test",
18+
Priority: new(Priority),
19+
}
20+
*f.Priority = P0
21+
22+
task := Task{Title: "Test Task"}
23+
f.ApplyToTask(&task)
24+
25+
if task.Priority != P0 {
26+
t.Errorf("expected priority P0, got %v", task.Priority)
27+
}
28+
hasTag := false
29+
for _, tg := range task.Tags {
30+
if tg == "test" {
31+
hasTag = true
32+
}
33+
}
34+
if !hasTag {
35+
t.Error("expected tag 'test' not found")
36+
}
37+
}

internal/plugins/host.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type Host struct {
5858
lastErr error
5959

6060
watcher *fsnotify.Watcher
61-
61+
6262
// For API feedback
6363
notifyFunc func(string, bool)
6464
}
@@ -507,7 +507,7 @@ func taskToTable(L *lua.LState, t core.Task) *lua.LTable {
507507
L.SetField(tbl, "description", lua.LString(t.Description))
508508
L.SetField(tbl, "status", lua.LString(string(t.Status)))
509509
L.SetField(tbl, "priority", lua.LNumber(t.Priority))
510-
510+
511511
tags := L.NewTable()
512512
for _, tg := range t.Tags {
513513
tags.Append(lua.LString(tg))

internal/storage/repo.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ func (r *Repository) SyncSnapshot(ctx context.Context) ([]core.Task, []Tombstone
216216
ORDER BY g.name ASC
217217
`, idSet...)
218218
if err == nil {
219-
defer func() {
220-
if err := tagRows.Close(); err != nil {
221-
_ = err // Suppress linter warning
222-
}
223-
}()
219+
defer func() {
220+
if err := tagRows.Close(); err != nil {
221+
_ = err // Suppress linter warning
222+
}
223+
}()
224224
tagsByID := map[string][]string{}
225225
for tagRows.Next() {
226226
var taskID, name string

internal/ui/detail/model.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func (m Model) renderMeta() string {
111111
}
112112

113113
if m.task.Deadline != nil {
114-
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
115-
m.styles.DetailKey.Render("Deadline"),
114+
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
115+
m.styles.DetailKey.Render("Deadline"),
116116
m.styles.DetailValue.Render(styles.IconDeadline+m.task.Deadline.Local().Format("Mon, Jan 02 15:04"))))
117117
}
118118

@@ -121,13 +121,13 @@ func (m Model) renderMeta() string {
121121
for _, t := range m.task.Tags {
122122
tagStr += styles.IconTag + t + " "
123123
}
124-
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
125-
m.styles.DetailKey.Render("Tags"),
124+
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
125+
m.styles.DetailKey.Render("Tags"),
126126
m.styles.DetailValue.Render(tagStr)))
127127
}
128128

129-
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
130-
m.styles.DetailKey.Render("Updated"),
129+
rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Left,
130+
m.styles.DetailKey.Render("Updated"),
131131
m.styles.DetailValue.Render(humanTime(m.task.UpdatedAt, time.Now()))))
132132

133133
return lipgloss.JoinVertical(lipgloss.Left, rows...)

internal/ui/tasklist/model.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
5353
case tea.KeyMsg:
5454
switch x.String() {
5555
case "up", "k":
56-
if (x.String() == "k" && !m.vimMode) {
56+
if x.String() == "k" && !m.vimMode {
5757
break
5858
}
5959
if m.sel > 0 {
6060
m.sel--
6161
}
6262
case "down", "j":
63-
if (x.String() == "j" && !m.vimMode) {
63+
if x.String() == "j" && !m.vimMode {
6464
break
6565
}
6666
if m.sel < len(m.tasks)-1 {
@@ -125,12 +125,12 @@ func (m Model) renderEmpty() string {
125125
icon := lipgloss.NewStyle().
126126
Foreground(m.styles.Theme.Accent).
127127
Render(styles.IconTask)
128-
128+
129129
msg := lipgloss.NewStyle().
130130
Foreground(m.styles.Theme.Fg).
131131
Bold(true).
132132
Render("No tasks here yet.")
133-
133+
134134
hint := m.styles.Muted.Render("Press 'n' to create your first task and stay productive.")
135135

136136
content := lipgloss.JoinVertical(lipgloss.Center,
@@ -170,7 +170,7 @@ func (m Model) renderRow(t core.Task, selected bool) string {
170170
left := lipgloss.JoinHorizontal(lipgloss.Left, indicator, status, " ", pri, " ", title)
171171

172172
rightParts := []string{}
173-
173+
174174
// Deadline
175175
if t.Deadline != nil {
176176
deadText := humanDeadline(*t.Deadline, time.Now())
@@ -198,7 +198,7 @@ func (m Model) renderRow(t core.Task, selected bool) string {
198198
}
199199

200200
line := left + strings.Repeat(" ", space) + right
201-
201+
202202
rowStyle := lipgloss.NewStyle().Width(m.width).Padding(0, 1)
203203
if selected {
204204
rowStyle = rowStyle.Background(m.styles.Theme.Overlay)

internal/util/util_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
package util
2-
3-
import (
4-
"testing"
5-
)
6-
7-
func TestAppStateDir(t *testing.T) {
8-
dir, err := AppStateDir("kairo_test")
9-
if err != nil {
10-
t.Fatalf("failed to get app dir: %v", err)
11-
}
12-
if dir == "" {
13-
t.Error("expected non-empty path")
14-
}
15-
}
1+
package util
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func TestAppStateDir(t *testing.T) {
8+
dir, err := AppStateDir("kairo_test")
9+
if err != nil {
10+
t.Fatalf("failed to get app dir: %v", err)
11+
}
12+
if dir == "" {
13+
t.Error("expected non-empty path")
14+
}
15+
}

0 commit comments

Comments
 (0)