jsonnet icon indicating copy to clipboard operation
jsonnet copied to clipboard

jsonnetfmt adds odd newlines at the end of the file

Open Andor opened this issue 5 years ago • 1 comments

If the file ends with a comment then jsonnetfmt filename.jsonnet will add odd newline at the end of the file.

andor@localhost:~/tmp$ jsonnetfmt --version
Jsonnet reformatter v0.16.0
andor@localhost:~/tmp$ cat testme.jsonnet
[]
// testme
andor@localhost:~/tmp$ jsonnetfmt testme.jsonnet
[]
// testme

andor@localhost:~/tmp$ jsonnetfmt testme.jsonnet | jsonnetfmt -
[]
// testme


andor@localhost:~/tmp$ jsonnetfmt testme.jsonnet | jsonnetfmt - | jsonnetfmt -
[]
// testme



andor@localhost:~/tmp$

Andor avatar Oct 08 '20 23:10 Andor

Fixed on main with this commit: https://github.com/google/jsonnet/commit/108e5d7ba7de3dfa42468461acbb3b1385aed629

netomi avatar Apr 18 '23 06:04 netomi

Closing as fixed (thanks @netomi for the commit reference!)

johnbartholomew avatar Mar 09 '24 22:03 johnbartholomew