Skip to content

Commit

Permalink
looser matching on sort logic
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed May 1, 2024
1 parent 0a843fe commit c4330ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions processor/formatters.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var tabularShortFormatFile = "%s %9d %8d %9d %8d %10d\n"
var shortFormatFileTruncate = 29
var shortNameTruncate = 20

var tabularShortUlocLanguageFormatBody = "%40d Unique Lines of Code (ULOC)\n"
var tabularShortUlocLanguageFormatBody = "(ULOC) %33d\n"
var tabularShortUlocGlobalFormatBody = "Unique Lines of Code (ULOC) %12d\n"

var tabularShortFormatHeadNoComplexity = "%-22s %11s %11s %10s %11s %9s\n"
Expand Down Expand Up @@ -67,7 +67,7 @@ var openMetricsFileRecordFormat = "scc_%s{language=\"%s\",file=\"%s\"} %d\n"

func sortSummaryFiles(summary *LanguageSummary) {
switch {
case SortBy == "name" || SortBy == "names" || SortBy == "language" || SortBy == "languages":
case SortBy == "name" || SortBy == "names" || SortBy == "language" || SortBy == "languages" || SortBy == "lang":
sort.Slice(summary.Files, func(i, j int) bool {
return strings.Compare(summary.Files[i].Location, summary.Files[j].Location) < 0
})
Expand All @@ -87,7 +87,7 @@ func sortSummaryFiles(summary *LanguageSummary) {
sort.Slice(summary.Files, func(i, j int) bool {
return summary.Files[i].Comment > summary.Files[j].Comment
})
case SortBy == "complexity" || SortBy == "complexitys":
case SortBy == "complexity" || SortBy == "complexitys" || SortBy == "comp":
sort.Slice(summary.Files, func(i, j int) bool {
return summary.Files[i].Complexity > summary.Files[j].Complexity
})
Expand Down

0 comments on commit c4330ff

Please sign in to comment.