looser matching on sort logic · boyter/scc@c4330ff

Original file line numberDiff line numberDiff line change

@@ -31,7 +31,7 @@ var tabularShortFormatFile = "%s %9d %8d %9d %8d %10d\n"

3131

var shortFormatFileTruncate = 29

3232

var shortNameTruncate = 20

3333
34-

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

34+

var tabularShortUlocLanguageFormatBody = "(ULOC) %33d\n"

3535

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

3636
3737

var tabularShortFormatHeadNoComplexity = "%-22s %11s %11s %10s %11s %9s\n"

@@ -67,7 +67,7 @@ var openMetricsFileRecordFormat = "scc_%s{language=\"%s\",file=\"%s\"} %d\n"

6767
6868

func sortSummaryFiles(summary *LanguageSummary) {

6969

switch {

70-

case SortBy == "name" || SortBy == "names" || SortBy == "language" || SortBy == "languages":

70+

case SortBy == "name" || SortBy == "names" || SortBy == "language" || SortBy == "languages" || SortBy == "lang":

7171

sort.Slice(summary.Files, func(i, j int) bool {

7272

return strings.Compare(summary.Files[i].Location, summary.Files[j].Location) < 0

7373

})

@@ -87,7 +87,7 @@ func sortSummaryFiles(summary *LanguageSummary) {

8787

sort.Slice(summary.Files, func(i, j int) bool {

8888

return summary.Files[i].Comment > summary.Files[j].Comment

8989

})

90-

case SortBy == "complexity" || SortBy == "complexitys":

90+

case SortBy == "complexity" || SortBy == "complexitys" || SortBy == "comp":

9191

sort.Slice(summary.Files, func(i, j int) bool {

9292

return summary.Files[i].Complexity > summary.Files[j].Complexity

9393

})