Skip to content

Commit 71ef2e6

Browse files
fix: resolve GitHub Actions CI failures and linting issues
- Fix test runner path reference in CI workflow (scripts/test_runner.go -> test_runner.go) - Fix unused parameter linting warnings across multiple files - Fix unchecked error returns (errcheck) in test files and app logic - Fix error string formatting issues (remove capitalization and punctuation) - Fix code flow issues (remove superfluous else statements)
1 parent 09ea58f commit 71ef2e6

File tree

11 files changed

+21
-23
lines changed

11 files changed

+21
-23
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
- name: 🎯 Run Complete Test Suite
194194
run: |
195195
echo "🎯 Running Comprehensive Test Suite..."
196-
go run scripts/test_runner.go
196+
go run test_runner.go
197197
198198
# ==================================================
199199
# 🏗️ Build & Release Artifacts

app/app_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ os.Setenv("HOME", tempDir)
108108
// Change to temp directory
109109
originalWd, err := os.Getwd()
110110
require.NoError(t, err)
111-
defer func() { os.Chdir(originalWd) }()
111+
defer func() { _ = os.Chdir(originalWd) }()
112112

113113
workDir := filepath.Join(tempDir, "project")
114114
err = os.MkdirAll(workDir, 0755)
@@ -201,6 +201,6 @@ b.ResetTimer()
201201
for i := 0; i < b.N; i++ {
202202
// Use different directory for each iteration
203203
testDir := fmt.Sprintf("/bench/dir/%d", i)
204-
app.AddTrustedDir(testDir)
204+
_ = app.AddTrustedDir(testDir)
205205
}
206206
}

app/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (m RootModel) handleScreenChange(msg models.ScreenChangeMsg) (RootModel, te
3838
switch msg.NewScreen {
3939
case models.Welcome:
4040
if data, ok := msg.Data.(string); ok {
41-
m.app.AddTrustedDir(data)
41+
_ = m.app.AddTrustedDir(data)
4242
m.currentModel = ui.NewWelcomeModel(data)
4343
}
4444

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,6 @@ func BenchmarkConfig_Validate(b *testing.B) {
311311

312312
b.ResetTimer()
313313
for i := 0; i < b.N; i++ {
314-
config.Validate()
314+
_ = config.Validate()
315315
}
316316
}

e2e/aura_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ os.Setenv("HOME", tempDir)
329329
// Change to temp directory
330330
originalWd, err := os.Getwd()
331331
require.NoError(t, err)
332-
t.Cleanup(func() { os.Chdir(originalWd) })
332+
t.Cleanup(func() { _ = os.Chdir(originalWd) })
333333

334334
err = os.Chdir(tempDir)
335335
require.NoError(t, err)
@@ -366,8 +366,8 @@ defer func() { os.Setenv("HOME", oldHome) }()
366366
os.Setenv("HOME", tempDir)
367367

368368
originalWd, _ := os.Getwd()
369-
defer os.Chdir(originalWd)
370-
os.Chdir(tempDir)
369+
defer func() { _ = os.Chdir(originalWd) }()
370+
_ = os.Chdir(tempDir)
371371

372372
// Create test config
373373
cfg := &config.Config{

llm/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ return "", fmt.Errorf("no content in response")
195195
return anthropicResp.Content[0].Text, nil
196196
}
197197

198-
func (c *Client) chatGemini(messages []Message) (string, error) {
198+
func (c *Client) chatGemini(_ []Message) (string, error) {
199199
// Placeholder for Gemini implementation
200-
return "", fmt.Errorf("Gemini integration coming soon! Please use OpenAI or Anthropic for now.")
200+
return "", fmt.Errorf("gemini integration coming soon! Please use OpenAI or Anthropic for now")
201201
}
202202

203-
func (c *Client) chatCohere(messages []Message) (string, error) {
203+
func (c *Client) chatCohere(_ []Message) (string, error) {
204204
// Placeholder for Cohere implementation
205-
return "", fmt.Errorf("Cohere integration coming soon! Please use OpenAI or Anthropic for now.")
205+
return "", fmt.Errorf("cohere integration coming soon! Please use OpenAI or Anthropic for now")
206206
}
207207

208208
// Helper function to create a coding assistant system prompt

llm/client_api_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestClient_ChatOpenAI_Success(t *testing.T) {
6464
}
6565

6666
w.Header().Set("Content-Type", "application/json")
67-
json.NewEncoder(w).Encode(response)
67+
_ = json.NewEncoder(w).Encode(response)
6868
}))
6969
defer server.Close()
7070

@@ -120,7 +120,7 @@ func TestClient_ChatAnthropic_Success(t *testing.T) {
120120
}
121121

122122
w.Header().Set("Content-Type", "application/json")
123-
json.NewEncoder(w).Encode(response)
123+
_ = json.NewEncoder(w).Encode(response)
124124
}))
125125
defer server.Close()
126126

@@ -143,9 +143,9 @@ func TestClient_ChatAnthropic_Success(t *testing.T) {
143143

144144
func TestClient_ChatOpenAI_APIError(t *testing.T) {
145145
// Create mock server that returns an error
146-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
146+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
147147
w.WriteHeader(http.StatusUnauthorized)
148-
w.Write([]byte(`{"error": {"message": "Invalid API key"}}`))
148+
_, _ = w.Write([]byte(`{"error": {"message": "Invalid API key"}}`))
149149
}))
150150
defer server.Close()
151151

@@ -202,7 +202,7 @@ func TestClient_ChatOpenAI_EmptyResponse(t *testing.T) {
202202
}
203203

204204
w.Header().Set("Content-Type", "application/json")
205-
json.NewEncoder(w).Encode(response)
205+
_ = json.NewEncoder(w).Encode(response)
206206
}))
207207
defer server.Close()
208208

models/models_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ assert.Equal(t, tt.wantMsg, msg)
266266
}
267267

268268
func TestConfirmationMsg(t *testing.T) {
269-
testCallback := func(confirmed bool) tea.Cmd {
269+
testCallback := func(_ bool) tea.Cmd {
270270
return func() tea.Msg {
271271
return StatusMsg{Message: "callback executed"}
272272
}

scripts/test_runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ fmt.Printf("Total: %d tests, %d passed, %d failed\n", totalTests, totalPassed, t
7171
if totalFailed > 0 {
7272
fmt.Printf("\n❌ Some tests failed. See output above for details.\n")
7373
os.Exit(1)
74-
} else {
75-
fmt.Printf("\n✅ All tests passed! 🎉\n")
7674
}
75+
fmt.Printf("\n✅ All tests passed! 🎉\n")
7776
}
7877

7978
type TestResult struct {

ui/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ return m, nil
262262
}
263263

264264
m.showSuccess = true
265-
return m, tea.Tick(time.Second*2, func(t time.Time) tea.Msg {
265+
return m, tea.Tick(time.Second*2, func(_ time.Time) tea.Msg {
266266
return models.ScreenChangeMsg{
267267
NewScreen: models.Welcome,
268268
Data: m.currentDir,

0 commit comments

Comments
 (0)