Skip to content

Commit

Permalink
cmd/cue: add newline between imported objects
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel van Lohuizen <mpvl@golang.org>

Change-Id: Ie537e739d8ea1a616a45677352fde090090fcc10
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/532275
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
mpvl committed Jan 31, 2022
1 parent 04812bf commit bd3b6ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/cue/cmd/orphans.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func placeOrphans(b *buildPlan, d *encoding.Decoder, pkg string, objs ...*ast.Fi
astinternal.DebugStr(x), arg)
}
}
ast.SetPos(label, token.NoPos)
a = append(a, cue.Label(label))
labels = append(labels, label)
}
Expand Down
21 changes: 21 additions & 0 deletions cmd/cue/cmd/testdata/script/import_merge.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cue import -o - x.yaml -l objects: -l metadata.name
cmp stdout expect-stdout

-- x.yaml --
kind: "foo"
metadata:
name: foo
---
kind: "foo"
metadata:
name: bar

-- expect-stdout --
objects: foo: {
kind: "foo"
metadata: name: "foo"
}
objects: bar: {
kind: "foo"
metadata: name: "bar"
}

0 comments on commit bd3b6ea

Please sign in to comment.