Skip to content

Commit

Permalink
fix: small issue in sorting by file location
Browse files Browse the repository at this point in the history
  • Loading branch information
norwoodj committed Oct 6, 2020
1 parent 4b2522d commit 3dd414c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions pkg/document/model.go
Expand Up @@ -56,13 +56,11 @@ func getChartTemplateData(chartDocumentationInfo helm.ChartDocumentationInfo, he
sortOrder := viper.GetString("sort-values-order")
if sortOrder == FileSortOrder {
sort.Slice(valuesTableRows, func(i, j int) bool {
if valuesTableRows[i].LineNumber < valuesTableRows[j].LineNumber {
return true
} else if valuesTableRows[i].Column < valuesTableRows[j].Column {
return true
if valuesTableRows[i].LineNumber == valuesTableRows[j].LineNumber {
return valuesTableRows[i].Column < valuesTableRows[j].Column
}

return false
return valuesTableRows[i].LineNumber < valuesTableRows[i].LineNumber
})
} else if sortOrder == AlphaNumSortOrder {
sort.Slice(valuesTableRows, func(i, j int) bool {
Expand Down
1 change: 0 additions & 1 deletion pkg/helm/chart_info.go
Expand Up @@ -49,7 +49,6 @@ type ChartRequirements struct {
}

type ChartValueDescription struct {
Order int
Description string
Default string
}
Expand Down

0 comments on commit 3dd414c

Please sign in to comment.