fix: address remaining review findings (interface assertions, DismissReview ctx, import order, filepath param, spelling)

This commit is contained in:
claw
2026-05-12 13:07:41 -07:00
parent b5a5533070
commit 7b0bfea336
5 changed files with 35 additions and 10 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ func GetAllFilesInPath(ctx context.Context, client FileReader, owner, repo, path
var walk func(string) error
walk = func(dir string) error {
if err := ctx.Err(); err != nil {
return fmt.Errorf("context cancelled during traversal: %w", err)
return fmt.Errorf("context canceled during traversal: %w", err)
}
entries, err := client.ListContents(ctx, owner, repo, dir)
@@ -47,7 +47,7 @@ func GetAllFilesInPath(ctx context.Context, client FileReader, owner, repo, path
for _, entry := range entries {
if err := ctx.Err(); err != nil {
return fmt.Errorf("context cancelled during traversal: %w", err)
return fmt.Errorf("context canceled during traversal: %w", err)
}
switch entry.Type {
+4 -4
View File
@@ -2,8 +2,8 @@ package vcs_test
import (
"context"
"strings"
"fmt"
"strings"
"testing"
"gitea.weiker.me/rodin/review-bot/vcs"
@@ -306,7 +306,7 @@ func TestGetAllFilesInPath_ErrorPropagation(t *testing.T) {
}
})
t.Run("cancelled context propagates", func(t *testing.T) {
t.Run("canceled context propagates", func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel() // Cancel immediately
@@ -322,9 +322,9 @@ func TestGetAllFilesInPath_ErrorPropagation(t *testing.T) {
}
_, err := vcs.GetAllFilesInPath(ctx, client, "owner", "repo", "src")
if err == nil {
t.Fatal("expected error from cancelled context, got nil")
t.Fatal("expected error from canceled context, got nil")
}
if !strings.Contains(err.Error(), "context cancelled") {
if !strings.Contains(err.Error(), "context canceled") {
t.Errorf("expected context cancellation error, got: %v", err)
}
})