Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cue: evaluation commands (excluding import) drop Yaml comments #3115

Open
myitcv opened this issue May 3, 2024 · 0 comments
Open

cmd/cue: evaluation commands (excluding import) drop Yaml comments #3115

myitcv opened this issue May 3, 2024 · 0 comments

Comments

@myitcv
Copy link
Member

myitcv commented May 3, 2024

What version of CUE are you using (cue version)?

$ cue version
cue version v0.0.0-20240501134849-612f1aed155f

go version go1.22.1
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
             vcs git
    vcs.revision 612f1aed155f8198f58a068d6286dcf31d339b21
        vcs.time 2024-05-01T13:48:49Z
    vcs.modified false
cue.lang.version v0.9.0

Does this issue reproduce with the latest release?

Yes

What did you do?

# Import
exec cue import x.yml

# Let's just ignore the fmt bug
cmp x.cue x.cue.golden

# Export
exec cue export --out cue x.yml
cmp stdout x.cue.golden

-- x.yml --
# this is a test
x: 5
-- x.cue.golden --
	// this is a test
x: 5

What did you expect to see?

Passing test (just look past the fmt-related issue)

What did you see instead?

# Import (0.013s)
# Let's just ignore the fmt bug (0.000s)
# Export (0.011s)
> exec cue export --out cue x.yml
[stdout]
x: 5
> cmp stdout x.cue.golden
--- stdout
+++ x.cue.golden
@@ -1,1 +1,2 @@
+       // this is a test
 x: 5

FAIL: /tmp/testscript911939675/repro.txtar/script.txtar:9: stdout and x.cue.golden differ

i.e. the cue export does not match the behaviour of cue import: Yaml comments are dropped via cue export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant