diff --git a/cmd/eval-dev-quality/cmd/report.go b/cmd/eval-dev-quality/cmd/report.go index 6e4f3616..7aba7c2c 100644 --- a/cmd/eval-dev-quality/cmd/report.go +++ b/cmd/eval-dev-quality/cmd/report.go @@ -69,7 +69,7 @@ func (command *Report) Execute(args []string) (err error) { return nil } - report.SortEvaluationRecords(records) + report.SortRecords(records) // Write all records into a single evaluation CSV file. evaluationFile, err := report.NewEvaluationFile(evaluationCSVFile) diff --git a/evaluate/report/csv.go b/evaluate/report/csv.go index 7b1e9594..a0deb79e 100644 --- a/evaluate/report/csv.go +++ b/evaluate/report/csv.go @@ -140,8 +140,8 @@ func assessmentFromRecord(assessmentFields []string) (assessments metrics.Assess return assessments, nil } -// SortEvaluationRecords sorts the evaluation records. -func SortEvaluationRecords(records [][]string) { +// SortRecords sorts CSV records. +func SortRecords(records [][]string) { sort.Slice(records, func(i, j int) bool { for x := range records[i] { if records[i][x] == records[j][x] { diff --git a/evaluate/report/csv_test.go b/evaluate/report/csv_test.go index 01b737e0..82beecab 100644 --- a/evaluate/report/csv_test.go +++ b/evaluate/report/csv_test.go @@ -260,7 +260,7 @@ func TestEvaluationFileWriteLines(t *testing.T) { }) } -func TestSortEvaluationRecords(t *testing.T) { +func TestSortRecords(t *testing.T) { type testCase struct { Name string @@ -271,7 +271,7 @@ func TestSortEvaluationRecords(t *testing.T) { validate := func(t *testing.T, tc *testCase) { t.Run(tc.Name, func(t *testing.T) { - SortEvaluationRecords(tc.Records) + SortRecords(tc.Records) assert.Equal(t, tc.ExpectedRecords, tc.Records) })