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: multi-byte characters in YAML result in bad formatting #826

Closed
cueckoo opened this issue Jul 3, 2021 · 4 comments
Closed

cmd/cue: multi-byte characters in YAML result in bad formatting #826

cueckoo opened this issue Jul 3, 2021 · 4 comments
Labels
fmt Related to formatting functionality. NeedsVerification

Comments

@cueckoo
Copy link
Collaborator

cueckoo commented Jul 3, 2021

Originally opened by @uhthomas in cuelang/cue#826

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

$ cue version
cue version v0.3.0-beta.5 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

curl -Lfv https://github.com/jetstack/cert-manager/releases/download/v1.2.0/cert-manager.yaml > t.yaml
cue import --list t.yaml

What did you expect to see?

A nicely formatted CUE file.

What did you see instead?

@cueckoo cueckoo added fmt Related to formatting functionality. NeedsFix labels Jul 3, 2021
@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @uhthomas in cuelang/cue#826 (comment)

Another example

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @myitcv in cuelang/cue#826 (comment)

Confirmed with 7c5d28e

@mpvl
Copy link
Member

mpvl commented Nov 23, 2021

Formatting looks fine to me. A more specific example is welcome.

@uhthomas
Copy link
Contributor

@mpvl Sorry, I must not have seen your comment.

Given https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.crds.yaml

❯ cue import --list cert-manager.yaml

Produces https://gist.github.com/uhthomas/da3842ef5880be0e26f05a00272a3ae4

The formatting is initially fine, but then looks really weird around here: https://gist.github.com/uhthomas/da3842ef5880be0e26f05a00272a3ae4#file-cert-manager-cue-L3081

apiVersion:
	"apiextensions.k8s.io/v1", kind:
	"CustomResourceDefinition", metadata: {

	name: "certificaterequests.cert-manager.io"
	labels: {
		app:                          "cert-manager"
		"app.kubernetes.io/name":     "cert-manager"
		"app.kubernetes.io/instance": "cert-manager"
		// Generated labels
		"app.kubernetes.io/version": "v1.11.0"
	}
}, spec: {

	group: "cert-manager.io"

I hope it's clear that something is wrong here.

@myitcv myitcv added this to the fmt-redesign milestone Apr 27, 2023
@mvdan mvdan self-assigned this Jun 13, 2023
@mvdan mvdan added the Triage Requires triage/attention label Jun 13, 2023
@myitcv myitcv added the zGarden label Jun 15, 2023
@mvdan mvdan changed the title cmd/cue: Weird formatting when importing large files cmd/cue: multi-byte characters in YAML result in bad formatting Nov 10, 2023
@mvdan mvdan removed Triage Requires triage/attention zGarden labels Nov 10, 2023
@mvdan mvdan removed their assignment Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fmt Related to formatting functionality. NeedsVerification
Projects
None yet
Development

No branches or pull requests

5 participants