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

improve pretty printing #141

Merged
merged 8 commits into from
Jun 3, 2022
Merged

improve pretty printing #141

merged 8 commits into from
Jun 3, 2022

Conversation

c-cube
Copy link
Member

@c-cube c-cube commented Jun 3, 2022

cf #140

Copy link
Member

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already much better not to have so many dangling opening parens. I'll fix the changelog on master.

CHANGES.md Outdated
@@ -41,6 +41,7 @@
- Avoid copying unnecessarily large amounts of strings when parsing (#85, #108,
@Leonidas-from-XIV)
- Fix `stream_to_file` (#133, @tcoopman and @gasche)
- Fix pretty-printing behavior for lists/objects inside lists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually go into a new unreleased section, I'll push this on master.

@c-cube c-cube force-pushed the tmp-pretty-2022-06-03 branch from 1a56a79 to e36bbfe Compare June 3, 2022 16:26
@Leonidas-from-XIV Leonidas-from-XIV merged commit 9630286 into master Jun 3, 2022
@Leonidas-from-XIV Leonidas-from-XIV deleted the tmp-pretty-2022-06-03 branch June 3, 2022 17:01
@mjambon
Copy link
Member

mjambon commented Jun 6, 2022

Don't you want to reserve wrapping (hov box) for only sequences of "atoms" (null, boolean, number, string, {}, []) like it was done before, and print the rest either horizontally or vertically (hv box)? This requires inspecting the list of items to determine the formatting style but it's lightweight. Please let me know if a PR would help.

@c-cube
Copy link
Member Author

c-cube commented Jun 7, 2022

Ah, that's interesting. I didn't realize it was done this way, but it makes sense (hv box for big objects is nicer). I think it can wait but that's just my personal opinion, and if you want to make a PR it'll make @Leonidas-from-XIV happy :)

@mjambon
Copy link
Member

mjambon commented Jun 7, 2022

@c-cube ok, the PR is in! #142

Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this pull request Jun 28, 2022
CHANGES:

*2022-06-28*

### Fixed

- Fix pretty-printing behavior for lists/objects inside lists (@c-cube
  ocaml-community/yojson#141, @mjambon ocaml-community/yojson#142)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants