Skip to content

Commit

Permalink
Merge pull request #395 from oribon/fix_md_order
Browse files Browse the repository at this point in the history
Fix docgen shuffling order of markdown everytime
  • Loading branch information
openshift-merge-robot authored Jan 16, 2021
2 parents 0a54764 + d7912a4 commit abeff09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cnf-tests/docgen/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ func descriptionsToList(descriptions map[string]string, matcher func(string) boo
if !matcher(n) {
continue
}
i := sort.Search(len(res), func(i int) bool { return res[i].Name >= n })
sanitizedName := sanitizeName(n)
i := sort.Search(len(res), func(i int) bool { return res[i].Name >= sanitizedName })
res = append(res, TestDescription{})
copy(res[i+1:], res[i:])
res[i] = TestDescription{sanitizeName(n), d}
res[i] = TestDescription{sanitizedName, d}
}
return res
}
Expand Down

0 comments on commit abeff09

Please sign in to comment.