Skip to content

Commit f100fb2

Browse files
author
Test
committed
fix(training): remove unused analyzeLogFile function (lint)
1 parent bd2986c commit f100fb2

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

cmd/gptcode/training.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8-
"regexp"
98
"sort"
109

1110
"github.com/spf13/cobra"
@@ -259,37 +258,3 @@ func init() {
259258
trainingCmd.AddCommand(trainingAnalyzeCmd)
260259
trainingCmd.AddCommand(trainingStatsCmd)
261260
}
262-
263-
// Helper for log analysis
264-
func analyzeLogFile(logPath string) ([]string, error) {
265-
data, err := os.ReadFile(logPath)
266-
if err != nil {
267-
return nil, err
268-
}
269-
270-
content := string(data)
271-
var issues []string
272-
273-
// Check for common error patterns
274-
errorPatterns := []struct {
275-
pattern string
276-
message string
277-
}{
278-
{`panic:`, "Panic detected"},
279-
{`fatal:`, "Fatal error"},
280-
{`error:.*not found`, "Resource not found error"},
281-
{`rate limit`, "Rate limiting hit"},
282-
{`context deadline exceeded`, "Timeout"},
283-
{`failed to compile`, "Compilation failure"},
284-
{`syntax error`, "Syntax error in generated code"},
285-
}
286-
287-
for _, ep := range errorPatterns {
288-
re := regexp.MustCompile(`(?i)` + ep.pattern)
289-
if re.MatchString(content) {
290-
issues = append(issues, ep.message)
291-
}
292-
}
293-
294-
return issues, nil
295-
}

0 commit comments

Comments
 (0)