Fix: linter complaints

This commit is contained in:
Grail Finder
2026-03-13 11:19:49 +03:00
parent 648035b194
commit 4cfe2fe37f
5 changed files with 0 additions and 12 deletions

View File

@@ -47,7 +47,6 @@ func isStopWord(word string) bool {
func detectPhrases(query string) []string {
words := strings.Fields(strings.ToLower(query))
var phrases []string
for i := 0; i < len(words)-1; i++ {
word1 := strings.Trim(words[i], ".,!?;:'\"()[]{}")
word2 := strings.Trim(words[i+1], ".,!?;:'\"()[]{}")
@@ -70,7 +69,6 @@ func detectPhrases(query string) []string {
}
}
}
return phrases
}
@@ -122,7 +120,6 @@ func areSlugsAdjacent(slug1, slug2 string) bool {
if prefix1 != prefix2 {
return false
}
batch1, chunk1, ok1 := parseSlugIndices(slug1)
batch2, chunk2, ok2 := parseSlugIndices(slug2)
if !ok1 || !ok2 {
@@ -843,7 +840,6 @@ func (r *RAG) GenerateQueryVariations(query string) []string {
}
}
}
return variations
}

View File

@@ -297,7 +297,6 @@ relative term as it was still a few kilometers away.
The clan house was made of brick and conformed to an older style of architecture. Nearly everyone knew about this mansion and its clock tower. It stood tall over the neighboring mansions and rumor had it that you could see the whole capital from the top. It
spoke to this clans renown and history that they were able to get away with building something that dwarfed the mansions of the nobility.`
chunks := []*models.VectorRow{
{
Slug: "kjv_bible.epub_1786_0",

View File

@@ -41,7 +41,6 @@ func TestRealBiblicalQuery(t *testing.T) {
t.Fatalf("failed to create RAG instance: %v", err)
}
t.Cleanup(func() { rag.Destroy() })
query := "bald prophet and two she bears"
results, err := rag.Search(query, 30)
if err != nil {
@@ -95,7 +94,6 @@ func TestRealQueryVariations(t *testing.T) {
t.Fatalf("failed to create RAG instance: %v", err)
}
t.Cleanup(func() { rag.Destroy() })
tests := []struct {
name string
query string

View File

@@ -30,7 +30,6 @@ func TestDetectPhrases(t *testing.T) {
expect: []string{},
},
}
for _, tt := range tests {
got := detectPhrases(tt.query)
if len(got) != len(tt.expect) {
@@ -73,7 +72,6 @@ func TestCountPhraseMatches(t *testing.T) {
expect: 2, // "she bears" and "bald prophet"
},
}
for _, tt := range tests {
got := countPhraseMatches(tt.text, tt.query)
if got != tt.expect {
@@ -119,7 +117,6 @@ func TestAreSlugsAdjacent(t *testing.T) {
expect: true, // sequential batches with same chunk index are adjacent
},
}
for _, tt := range tests {
got := areSlugsAdjacent(tt.slug1, tt.slug2)
if got != tt.expect {
@@ -141,7 +138,6 @@ func TestParseSlugIndices(t *testing.T) {
{"file_abc_def", 0, 0, false},
{"file_123_456_extra", 456, 0, false}, // regex matches last two numbers
}
for _, tt := range tests {
batch, chunk, ok := parseSlugIndices(tt.slug)
if ok != tt.wantOk {

View File

@@ -162,7 +162,6 @@ func (p ProviderSQL) ListFiles() ([]string, error) {
return nil, err
}
defer rows.Close()
var allFiles []string
for rows.Next() {
var filename string