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

Jsonnetfmt needs to be run multiple time to fix a file #503

Open
graywolf-at-work opened this issue Jan 19, 2021 · 1 comment
Open

Jsonnetfmt needs to be run multiple time to fix a file #503

graywolf-at-work opened this issue Jan 19, 2021 · 1 comment

Comments

@graywolf-at-work
Copy link

+$ printf '{}\n//\n' >a.jsonnet
+$ cp a.jsonnet orig.jsonnet
+$ while ! jsonnetfmt --test a.jsonnet; do
+> jsonnetfmt -i a.jsonnet
+> diff -u orig.jsonnet a.jsonnet
+> done
--- orig.jsonnet        2021-01-19 23:26:35.129851360 +0100
+++ a.jsonnet   2021-01-19 23:28:04.271007497 +0100
@@ -1,2 +1,3 @@
 {}
 //
+
--- orig.jsonnet        2021-01-19 23:26:35.129851360 +0100
+++ a.jsonnet   2021-01-19 23:28:04.811014462 +0100
@@ -1,2 +1,4 @@
 {}
 //
+
+
--- orig.jsonnet        2021-01-19 23:26:35.129851360 +0100
+++ a.jsonnet   2021-01-19 23:28:05.321021040 +0100
@@ -1,2 +1,5 @@
 {}
 //
+
+
+
+$
@sbarzowski
Copy link
Collaborator

Thanks. This is a bug. The formatter is supposed to be idempotent (i.e. forall(input) . formatter(formatter(input)) = formatter(input)).

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

2 participants