cue
cue copied to clipboard
cmd/cue: select best quoting mechanism when importing
Originally opened by @mvdan in https://github.com/cuelang/cue/issues/124
Imagine the yaml below:
cmds:
- printf "%!s(MISSING)" $FOO
This will end up something like "printf \"%!s(MISSING)\" $FOO". It would be nicer if it instead avoided the backslashes, like #"printf "%!s(MISSING)" $FOO"#.
Perhaps it could do the same for multi-line strings and other common scenarios. This isn't about saving bytes, but about readability.
/cc @rogpeppe
Original reply by @mpvl in https://github.com/cuelang/cue/issues/124#issuecomment-535448216
A general "pretty quoter" is somewhat non-trivial, which is why I haven't done it yet.
But I agree this would be better.