cue icon indicating copy to clipboard operation
cue copied to clipboard

cue/fmt: various formatting issues

Open verdverm opened this issue 2 years ago • 3 comments

There is an extra tab indentation in the following after cue fmt

machine_type: [
		if arch == "amd" {"n2-standard-2"},
		if arch == "arm" {"t2a-standard-2"},
		"unknown arch",
][0]

cue fmt actually turns the expected output into the unexpected (with an extra tab)

exec cue fmt file.cue
cmp file.cue golden.cue

-- file.cue --
arch: string
machine_type: [
	if arch == "amd" {"n2-standard-2"},
	if arch == "arm" {"t2a-standard-2"},
	"unknown arch",
][0]
-- golden.cue --
arch: string
machine_type: [
	if arch == "amd" {"n2-standard-2"},
	if arch == "arm" {"t2a-standard-2"},
	"unknown arch",
][0]

If you remove the [0] from the end, it no longer has the extra tab indentation

verdverm avatar Jul 19 '23 00:07 verdverm