Skip to content

Commit

Permalink
Use newlines in config/generated.lst to prevent git conflicts (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbbush authored Jun 6, 2024
1 parent cde0ffc commit bda86c9
Show file tree
Hide file tree
Showing 2 changed files with 942 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ func dumpGeneratedResourceList(p *ujconfig.Provider, targetPath *string) {
generatedResources = append(generatedResources, name)
}
sort.Strings(generatedResources)
buff, err := json.Marshal(generatedResources)
// Indentation is not necessary, as it's a flat JSON array, but newlines prevent git conflicts from concurrent PRs
// adding new resources that are not alphabetically adjacent.
buff, err := json.MarshalIndent(generatedResources, "", "")
if err != nil {
panic(fmt.Sprintf("Cannot marshal native schema versions to JSON: %s", err.Error()))
}
Expand Down
Loading

0 comments on commit bda86c9

Please sign in to comment.