-
Notifications
You must be signed in to change notification settings - Fork 330
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
--no-sort option is unstable #102
Comments
BTW this tool is fantastic and helps me a lot! Thanks for creating it :) |
|
Well, I guessed that might be the cause, but the underlying implementation shouldn't matter, right? The option is confusing when it works this way. What's the use of a non-sorted output if the input is being modified in the first place 😅? |
Hi, for i in $( seq 1000 ); do echo '{"z": "first", "a": "last"}' | gron --no-sort | column -x; done | sort | uniq -c; 130 json = {}; json.a = "last"; json.z = "first"; 1000 json = {} json.z = "first" json.a = "last" |
+1 to |
--no-sort does not always preserve input order, hence it's better to sort for deterministic output refs tomnomnom/gron#102
--no-sort does not always preserve input order, hence it's better to sort for deterministic output refs tomnomnom/gron#102
For a simple JSON doc
gron --no-sort
keeps producing wrong results at around 12% rate.Tried it with:
Tried it with:
The text was updated successfully, but these errors were encountered: