-
Notifications
You must be signed in to change notification settings - Fork 294
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
Cue commands that generate json/other files should have the option --compact #2477
Comments
Modulo naming, this seems a reasonable feature request. |
Please include the comma-delimited, white-space-removed (comments removed?) single-line form of CUE in the set of output formats being targeted by this Issue's putative option. |
Updated the title to reflect that this request is not specific to JSON, but could/should be applied to all output formats. |
#2492 was more a convergent request than a duplicate of this one. I limited my request to JSON because it corresponds to the immediate need of my project, but
Questions, for my CUEducation:
|
[snip]
Unofficial answers from an enCUEsiast, rather than someone who definitively knows what they're taking about:
Yes. If you use the rudimentary I'm confident there are also other corner cases it fails to deal with.
This section of the language guide might be useful: https://cuelang.org/docs/references/spec/#lexical-elements I didn't use that, however - it was more trial and error :-)
I'm not sure a display-only form of the language exists. Personally, I'm only interested in a form that can be used as input. |
@jpluscplusm Thank you for the guidance, I'll follow it up (not as my first priority). By 'display-only format' I meant something like this, for use in testing
|
Is there anyone already working on this? |
Is your feature request related to a problem? Please describe.
While commands
def
,export
andeval
generate indented json files, in some applications the compact (minified) json is desirable, for space and time economy.Describe the solution you'd like
cue export data.cue --compact
should produce a compactdata.json
file.Describe alternatives you've considered
I can reformat the indented json file with jq or any similar tool, but getting it on demand from cue would be more efficient.
Additional context
The only mention of
compact
in CUE issues and in pull requests I could find is in PR #1549, suggested as a possibility by @mpvl and commented on favourably by @rogpeppe and @felixge.While the desired effect of
--compact
is obvious for json, for other formats discussed in #1549 probably should be 'minify', i.e. remove anything that conveys no machine readable information.The text was updated successfully, but these errors were encountered: