Skip to content

internal/filetypes: unexpected acceptance of arbitrary tag=value pairs #3283

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

Closed
rogpeppe opened this issue Jul 12, 2024 · 1 comment
Closed

Comments

@rogpeppe
Copy link
Member

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

$ cue version
v0.10.0-alpha.1

Does this issue reproduce with the latest stable release?

Yes (v0.9.2)

What did you do?

! exec cue export json+iddfghdfg=sdfvdfsvb+anythingelse=blah: x

-- x --
{"foo": true}

What did you expect to see?

A passing test

What did you see instead?

> ! exec cue export json+unknowntag=somearbitraryvalue+anythingelse=blah: x
[stdout]
{
    "foo": true
}
FAIL: /tmp/x.txtar:1: unexpected command success

Even though there is clearly no tag unknowntag pr anythingelse, the filetype logic lets it through without issue.

There is probably further conversation to be had about whether attr=val-style filetype attributes
are worth having in general. The ability to have arbitrary values arguably makes it harder to
solve issue #3280 because the set of possible parameters becomes open-ended,
and this style of attribute is not actually used for anything significant in practiced currently.

cueckoo pushed a commit that referenced this issue Sep 10, 2024
Currently, arbitrary key-value pairs can be specified in a filetype,
but this isn't ideal behavior.

Add a test for this, to be fixed in a subsequent CL.

For #3283.

Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I2d18509e116f427a8eca19899329df0e68ab2255
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200900
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
@rogpeppe
Copy link
Member Author

Fixed by https://cuelang.org/cl/1200901

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